slice-machine-ui 2.18.1-alpha.jp-unauthorized-error-improvement.8 → 2.18.1-alpha.jp-remove-shared-onboarding-experiment.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/7uIqfRATU8iBj2XIUVUvD/_buildManifest.js +1 -0
- package/out/_next/static/chunks/157-fa8b348c960c8283.js +3 -0
- package/out/_next/static/chunks/{248-a9c33f7fbe2da2f1.js → 248-bcd84e3d28d25f54.js} +1 -1
- package/out/_next/static/chunks/256-07f768a2b19b0a0e.js +4 -0
- package/out/_next/static/chunks/34-ca8515dda61c7c8a.js +1 -0
- package/out/_next/static/chunks/344-fdb3008f4bb3b0c1.js +1 -0
- package/out/_next/static/chunks/484-3e011e79c41f0342.js +1 -0
- package/out/_next/static/chunks/{489-a046ae0fa4f74435.js → 489-d85cd66ad0405bee.js} +1 -1
- package/out/_next/static/chunks/500-d3989390f5e8da53.js +1 -0
- package/out/_next/static/chunks/52d4c156-89c6ec6efca0a0bb.js +1 -0
- package/out/_next/static/chunks/630-7e1844076846ca4d.js +1 -0
- package/out/_next/static/chunks/{647-4379a741c8d85d9e.js → 647-aa094286bc248d52.js} +1 -1
- package/out/_next/static/chunks/{907-445266211c48b1a5.js → 907-180eb33eefccc237.js} +1 -1
- package/out/_next/static/chunks/a6495ab1.00190ac98e794d8f.js +28 -0
- package/out/_next/static/chunks/pages/{_app-6ee99840ce68524b.js → _app-d31f7ba82a417786.js} +212 -212
- package/out/_next/static/chunks/pages/{changelog-3901f2fc937d9648.js → changelog-fbed93d315cb5429.js} +1 -1
- package/out/_next/static/chunks/pages/changes-2d9f27b360c0f73d.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-816acb31b652239b.js → [customTypeId]-af9376721beb489e.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-dd04033db23a58f3.js → labs-34147f008c958a89.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-669d5479e81b638b.js → [pageTypeId]-a24665e91b882169.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-f237aaa755dc9a99.js → simulator-761a04bb54f8d60b.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-dac1c4223724ff24.js +1 -0
- package/out/_next/static/chunks/pages/slices-08fad24cf5a81c9c.js +1 -0
- package/out/_next/static/chunks/webpack-24ddb02bea621501.js +1 -0
- package/out/_next/static/css/{303dad78be1eb854.css → bc89f2cd4e4781f5.css} +1 -1
- package/out/_next/static/css/e8e03c0d4003d1eb.css +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/src/{features/errorBoundaries/DefaultErrorBoundary.tsx → ErrorBoundary.tsx} +2 -2
- package/src/features/auth/LogoutButton.tsx +36 -42
- package/src/features/builder/fields/contentRelationship/ContentRelationshipFieldPicker.tsx +3 -3
- package/src/features/changes/StatusBadge.tsx +9 -1
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +3 -3
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +3 -3
- package/src/features/environments/actions/setEnvironment.ts +18 -0
- package/src/features/environments/useActiveEnvironment.ts +9 -17
- package/src/features/environments/useEnvironments.ts +8 -11
- package/src/features/labs/labsList/LabsPage.tsx +3 -3
- package/src/features/navigation/Navigation.tsx +8 -7
- package/src/features/navigation/RepositoryInfo.tsx +24 -18
- package/src/features/onboarding/OnboardingGuide.tsx +2 -5
- package/src/features/onboarding/useOnboarding.ts +1 -14
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -3
- package/src/features/sync/AutoSyncProvider.tsx +2 -2
- package/src/features/sync/getUnSyncChanges.ts +3 -1
- package/src/legacy/components/AppLayout/index.tsx +85 -10
- package/src/legacy/components/ChangesEmptyState/AuthErrorPage.tsx +44 -0
- package/src/legacy/components/ChangesEmptyState/index.ts +1 -1
- package/src/legacy/components/ChangesItems/ChangesItems.tsx +3 -3
- package/src/legacy/components/LoginModal/index.tsx +6 -14
- package/src/legacy/components/Navigation/ChangesItem.tsx +48 -96
- package/src/legacy/components/Navigation/Environment.tsx +7 -2
- package/src/legacy/components/Navigation/SideNavEnvironmentSelector/SideNavEnvironmentSelector.tsx +8 -3
- package/src/legacy/components/Simulator/index.tsx +3 -3
- package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -3
- package/src/modules/userContext/index.ts +5 -5
- package/src/modules/userContext/types.ts +3 -2
- package/src/pages/_app.tsx +95 -93
- package/src/pages/changes.tsx +5 -4
- package/test/__testutils__/index.tsx +10 -13
- package/out/_next/static/0C8VxwongjXZwHPchBnOi/_buildManifest.js +0 -1
- package/out/_next/static/chunks/04ad993f.d7f986af0f739cc9.js +0 -28
- package/out/_next/static/chunks/34-50c64778da33cff6.js +0 -1
- package/out/_next/static/chunks/349-7118116b93278f73.js +0 -4
- package/out/_next/static/chunks/429-1137c819c2bf6b66.js +0 -3
- package/out/_next/static/chunks/50-586dc7ab5e584e76.js +0 -1
- package/out/_next/static/chunks/630-eae75e90b30f201a.js +0 -1
- package/out/_next/static/chunks/pages/changes-c58a60af39167147.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-e6bc7cc6186d6a0f.js +0 -1
- package/out/_next/static/chunks/pages/slices-bf63f937b184b470.js +0 -1
- package/out/_next/static/chunks/webpack-e0c07a2fe4908d81.js +0 -1
- package/out/_next/static/css/cdee5b195444f185.css +0 -1
- package/src/features/environments/actions/useSetEnvironment.ts +0 -22
- package/src/features/errorBoundaries/AppStateErrorBoundary.tsx +0 -108
- package/src/features/errorBoundaries/index.ts +0 -2
- package/src/features/onboarding/useSharedOnboardingExperiment.ts +0 -6
- package/src/legacy/components/ChangesEmptyState/UnauthenticatedView.tsx +0 -31
- package/src/queryClient.tsx +0 -24
- /package/out/_next/static/{0C8VxwongjXZwHPchBnOi → 7uIqfRATU8iBj2XIUVUvD}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[344],{81207:function(e){e.exports=function(e,t,n,o){var i=-1,r=null==e?0:e.length;for(o&&r&&(n=e[++i]);++i<r;)n=t(n,e[i],i,e);return n}},50217:function(e){e.exports=function(e){return e.split("")}},45981:function(e){var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},6435:function(e){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},23895:function(e,t,n){var o=n(39872);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:o(e,t,n)}},83126:function(e,t,n){var o=n(23895),i=n(33880),r=n(54996),a=n(66188);e.exports=function(e){return function(t){var n=i(t=a(t))?r(t):void 0,u=n?n[0]:t.charAt(0),s=n?o(n,1).join(""):t.slice(1);return u[e]()+s}}},34311:function(e,t,n){var o=n(81207),i=n(97329),r=n(11618),a=RegExp("['’]","g");e.exports=function(e){return function(t){return o(r(i(t).replace(a,"")),e,"")}}},61655:function(e,t,n){var o=n(6435)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=o},33880:function(e){var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},83559:function(e){var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},54996:function(e,t,n){var o=n(50217),i=n(33880),r=n(63344);e.exports=function(e){return i(e)?r(e):o(e)}},63344:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\ud83c[\udffb-\udfff]",i="[^"+t+"]",r="(?:\ud83c[\udde6-\uddff]){2}",a="[\ud800-\udbff][\udc00-\udfff]",u="(?:"+n+"|"+o+")?",s="[\\ufe0e\\ufe0f]?",l="(?:\\u200d(?:"+[i,r,a].join("|")+")"+s+u+")*",c=RegExp(o+"(?="+o+")|(?:"+[i+n+"?",n,r,a,"["+t+"]"].join("|")+")"+(s+u+l),"g");e.exports=function(e){return e.match(c)||[]}},75304:function(e){var t="\ud800-\udfff",n="\\u2700-\\u27bf",o="a-z\\xdf-\\xf6\\xf8-\\xff",i="A-Z\\xc0-\\xd6\\xd8-\\xde",r="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",a="['’]",u="["+r+"]",s="["+o+"]",l="[^"+t+r+"\\d+"+n+o+i+"]",c="(?:\ud83c[\udde6-\uddff]){2}",d="[\ud800-\udbff][\udc00-\udfff]",p="["+i+"]",f="(?:"+s+"|"+l+")",h="(?:"+a+"(?:d|ll|m|re|s|t|ve))?",m="(?:"+a+"(?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",g="[\\ufe0e\\ufe0f]?",b="(?:\\u200d(?:"+["[^"+t+"]",c,d].join("|")+")"+g+v+")*",y="(?:"+["["+n+"]",c,d].join("|")+")"+(g+v+b),O=RegExp([p+"?"+s+"+"+h+"(?="+[u,p,"$"].join("|")+")","(?:"+p+"|"+l+")+"+m+"(?="+[u,p+f,"$"].join("|")+")",p+"?"+f+"+"+h,p+"+"+m,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",y].join("|"),"g");e.exports=function(e){return e.match(O)||[]}},96009:function(e,t,n){var o=n(82108),i=n(34311)(function(e,t,n){return t=t.toLowerCase(),e+(n?o(t):t)});e.exports=i},82108:function(e,t,n){var o=n(66188),i=n(23779);e.exports=function(e){return i(o(e).toLowerCase())}},97329:function(e,t,n){var o=n(61655),i=n(66188),r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(r,o).replace(a,"")}},85505:function(e,t,n){var o=n(53366),i=n(86152),r=n(15125);e.exports=function(e){return"string"==typeof e||!i(e)&&r(e)&&"[object String]"==o(e)}},23779:function(e,t,n){var o=n(83126)("toUpperCase");e.exports=o},11618:function(e,t,n){var o=n(45981),i=n(83559),r=n(66188),a=n(75304);e.exports=function(e,t,n){return(e=r(e),void 0===(t=n?void 0:t))?i(e)?a(e):o(e):e.match(t)||[]}},36131:function(e,t,n){"use strict";n.d(t,{ZP:function(){return ta}});var o,i,r,a=n(33028),u=n(59147);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,a,u=[],s=!0,l=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=r.call(n)).done)&&(u.push(o.value),u.length!==t);s=!0);}catch(e){l=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||(0,u.Z)(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var l=n(59740),c=n(2784),d=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"],p=n(7896),f=n(9249),h=n(87371),m=n(45754),v=n(4309),g=n(51171),b=n(28165),y=n(86522),O=n(56666),x=n(28316);function C(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Z(e){return C(e).getComputedStyle(e)}function w(e){return e instanceof C(e).Node}function I(e){return w(e)?(e.nodeName||"").toLowerCase():""}function S(e){return e instanceof C(e).HTMLElement}function E(e){return e instanceof C(e).Element}function V(e){return"undefined"!=typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}function M(e){let{overflow:t,overflowX:n,overflowY:o,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let R=Math.round;function L(e){return E(e)?e:e.contextElement}let k={x:1,y:1};function D(e){let t=L(e);if(!S(t))return k;let n=t.getBoundingClientRect(),{width:o,height:i,fallback:r}=function(e){let t=Z(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=S(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,u=R(n)!==r||R(o)!==a;return u&&(n=r,o=a),{width:n,height:o,fallback:u}}(t),a=(r?R(n.width):n.width)/o,u=(r?R(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),u&&Number.isFinite(u)||(u=1),{x:a,y:u}}let P={x:0,y:0};function F(e,t,n,o){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let r=e.getBoundingClientRect(),a=L(e),u=k;t&&(o?E(o)&&(u=D(o)):u=D(e));let s=function(e,t,n){var o,i;if(void 0===t&&(t=!0),!(!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")))return P;let r=e?C(e):window;return!n||t&&n!==r?P:{x:(null==(o=r.visualViewport)?void 0:o.offsetLeft)||0,y:(null==(i=r.visualViewport)?void 0:i.offsetTop)||0}}(a,n,o),l=(r.left+s.x)/u.x,c=(r.top+s.y)/u.y,d=r.width/u.x,p=r.height/u.y;if(a){let e=C(a),t=o&&E(o)?C(o):o,n=e.frameElement;for(;n&&o&&t!==e;){let e=D(n),t=n.getBoundingClientRect(),o=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(o.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(o.paddingTop))*e.y,l*=e.x,c*=e.y,d*=e.x,p*=e.y,l+=t.x,c+=t.y,n=C(n).frameElement}}return{...i={width:d,height:p,x:l,y:c},top:i.y,left:i.x,right:i.x+i.width,bottom:i.y+i.height}}function T(e,t){var n;void 0===t&&(t=[]);let o=function e(t){let n=function(e){if("html"===I(e))return e;let t=e.assignedSlot||e.parentNode||V(e)&&e.host||((w(e)?e.ownerDocument:e.document)||window.document).documentElement;return V(t)?t.host:t}(t);return["html","body","#document"].includes(I(n))?n.ownerDocument.body:S(n)&&M(n)?n:e(n)}(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),r=C(o);return i?t.concat(r,r.visualViewport||[],M(o)?o:[]):t.concat(o,T(o))}var A=c.useLayoutEffect,H=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],U=function(){};function z(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];var r=[].concat(o);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&r.push("".concat(a?"-"===a[0]?e+a:e+"__"+a:e));return r.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var N=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===(0,y.Z)(e)&&null!==e?[e]:[]},B=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=(0,l.Z)(e,H);return(0,a.Z)({},t)},j=function(e,t,n){var o=e.cx,i=e.getStyles,r=e.getClassNames,a=e.className;return{css:i(t,e),className:o(null!=n?n:{},r(t,e),a)}};function W(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Y(e){return W(e)?window.pageYOffset:e.scrollTop}function G(e,t){if(W(e)){window.scrollTo(0,t);return}e.scrollTop=t}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:U,i=Y(e),r=t-i,a=0;!function t(){var u;a+=10,G(e,r*((u=(u=a)/n-1)*u*u+1)+i),a<n?window.requestAnimationFrame(t):o(e)}()}function X(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),i=t.offsetHeight/3;o.bottom+i>n.bottom?G(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):o.top-i<n.top&&G(e,Math.max(t.offsetTop-i,0))}function q(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var K=!1,J="undefined"!=typeof window?window:{};J.addEventListener&&J.removeEventListener&&(J.addEventListener("p",U,{get passive(){return K=!0}}),J.removeEventListener("p",U,!1));var $=K;function Q(e){return null!=e}var ee=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return Object.entries(e).filter(function(e){var t=s(e,1)[0];return!n.includes(t)}).reduce(function(e,t){var n=s(t,2),o=n[0],i=n[1];return e[o]=i,e},{})},et=function(e){return"auto"===e?"bottom":e},en=(0,c.createContext)(null),eo=function(e){var t=e.children,n=e.minMenuHeight,o=e.maxMenuHeight,i=e.menuPlacement,r=e.menuPosition,u=e.menuShouldScrollIntoView,l=e.theme,d=((0,c.useContext)(en)||{}).setPortalPlacement,p=(0,c.useRef)(null),f=s((0,c.useState)(o),2),h=f[0],m=f[1],v=s((0,c.useState)(null),2),g=v[0],b=v[1],y=l.spacing.controlHeight;return A(function(){var e=p.current;if(e){var t="fixed"===r,a=function(e){var t=e.maxHeight,n=e.menuEl,o=e.minHeight,i=e.placement,r=e.shouldScroll,a=e.isFixedPosition,u=e.controlHeight,s=function(e){var t=getComputedStyle(e),n="absolute"===t.position,o=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!n||"static"!==t.position)&&o.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var c=s.getBoundingClientRect().height,d=n.getBoundingClientRect(),p=d.bottom,f=d.height,h=d.top,m=n.offsetParent.getBoundingClientRect().top,v=a?window.innerHeight:W(s)?window.innerHeight:s.clientHeight,g=Y(s),b=parseInt(getComputedStyle(n).marginBottom,10),y=parseInt(getComputedStyle(n).marginTop,10),O=m-y,x=v-h,C=O+g,Z=c-g-h,w=p-v+g+b,I=g+h-y;switch(i){case"auto":case"bottom":if(x>=f)return{placement:"bottom",maxHeight:t};if(Z>=f&&!a)return r&&_(s,w,160),{placement:"bottom",maxHeight:t};if(!a&&Z>=o||a&&x>=o)return r&&_(s,w,160),{placement:"bottom",maxHeight:a?x-b:Z-b};if("auto"===i||a){var S=t,E=a?O:C;return E>=o&&(S=Math.min(E-b-u,t)),{placement:"top",maxHeight:S}}if("bottom"===i)return r&&G(s,w),{placement:"bottom",maxHeight:t};break;case"top":if(O>=f)return{placement:"top",maxHeight:t};if(C>=f&&!a)return r&&_(s,I,160),{placement:"top",maxHeight:t};if(!a&&C>=o||a&&O>=o){var V=t;return(!a&&C>=o||a&&O>=o)&&(V=a?O-y:C-y),r&&_(s,I,160),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw Error('Invalid placement provided "'.concat(i,'".'))}return l}({maxHeight:o,menuEl:e,minHeight:n,placement:i,shouldScroll:u&&!t,isFixedPosition:t,controlHeight:y});m(a.maxHeight),b(a.placement),null==d||d(a.placement)}},[o,i,r,u,n,d,y]),t({ref:p,placerProps:(0,a.Z)((0,a.Z)({},e),{},{placement:g||et(i),maxHeight:h})})},ei=function(e,t){var n=e.theme,o=n.spacing.baseUnit,i=n.colors;return(0,a.Z)({textAlign:"center"},t?{}:{color:i.neutral40,padding:"".concat(2*o,"px ").concat(3*o,"px")})},er=function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),t)};er.defaultProps={children:"No options"};var ea=function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),t)};ea.defaultProps={children:"Loading..."};var eu=["size"],es={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},el=function(e){var t=e.size,n=(0,l.Z)(e,eu);return(0,b.tZ)("svg",(0,p.Z)({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:es},n))},ec=function(e){return(0,b.tZ)(el,(0,p.Z)({size:20},e),(0,b.tZ)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},ed=function(e){return(0,b.tZ)(el,(0,p.Z)({size:20},e),(0,b.tZ)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ep=function(e,t){var n=e.isFocused,o=e.theme,i=o.spacing.baseUnit,r=o.colors;return(0,a.Z)({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?r.neutral60:r.neutral20,padding:2*i,":hover":{color:n?r.neutral80:r.neutral40}})},ef=(0,b.F4)(r||(o=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],i||(i=o.slice(0)),r=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(i)}})))),eh=function(e){var t=e.delay,n=e.offset;return(0,b.tZ)("span",{css:(0,b.iv)({animation:"".concat(ef," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},em=function(e){var t=e.innerProps,n=e.isRtl;return(0,b.tZ)("div",(0,p.Z)({},j(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),(0,b.tZ)(eh,{delay:0,offset:n}),(0,b.tZ)(eh,{delay:160,offset:!0}),(0,b.tZ)(eh,{delay:320,offset:!n}))};em.defaultProps={size:4};var ev=["data"],eg=["innerRef","isDisabled","isHidden","inputClassName"],eb={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},ey={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":(0,a.Z)({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},eb)},eO=function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",n,t)},ex={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||(0,b.tZ)(ec,null))},Control:function(e){var t=e.children,n=e.isDisabled,o=e.isFocused,i=e.innerRef,r=e.innerProps,a=e.menuIsOpen;return(0,b.tZ)("div",(0,p.Z)({ref:i},j(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":o,"control--menu-is-open":a}),r),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||(0,b.tZ)(ed,null))},DownChevron:ed,CrossIcon:ec,Group:function(e){var t=e.children,n=e.cx,o=e.getStyles,i=e.getClassNames,r=e.Heading,a=e.headingProps,u=e.innerProps,s=e.label,l=e.theme,c=e.selectProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"group",{group:!0}),u),(0,b.tZ)(r,(0,p.Z)({},a,{selectProps:c,theme:l,getStyles:o,getClassNames:i,cx:n}),s),(0,b.tZ)("div",null,t))},GroupHeading:function(e){var t=B(e);t.data;var n=(0,l.Z)(t,ev);return(0,b.tZ)("div",(0,p.Z)({},j(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return(0,b.tZ)("span",(0,p.Z)({},t,j(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,o=B(e),i=o.innerRef,r=o.isDisabled,u=o.isHidden,s=o.inputClassName,c=(0,l.Z)(o,eg);return(0,b.tZ)("div",(0,p.Z)({},j(e,"input",{"input-container":!0}),{"data-value":n||""}),(0,b.tZ)("input",(0,p.Z)({className:t({input:!0},s),ref:i,style:(0,a.Z)({label:"input",color:"inherit",background:0,opacity:u?0:1,width:"100%"},eb),disabled:r},c)))},LoadingIndicator:em,Menu:function(e){var t=e.children,n=e.innerRef,o=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"menu",{menu:!0}),{ref:n},o),t)},MenuList:function(e){var t=e.children,n=e.innerProps,o=e.innerRef,i=e.isMulti;return(0,b.tZ)("div",(0,p.Z)({},j(e,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:o},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,o=e.controlElement,i=e.innerProps,r=e.menuPlacement,u=e.menuPosition,l=(0,c.useRef)(null),d=(0,c.useRef)(null),f=s((0,c.useState)(et(r)),2),h=f[0],m=f[1],v=(0,c.useMemo)(function(){return{setPortalPlacement:m}},[]),g=s((0,c.useState)(null),2),y=g[0],O=g[1],C=(0,c.useCallback)(function(){if(o){var e,t={bottom:(e=o.getBoundingClientRect()).bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width},n="fixed"===u?0:window.pageYOffset,i=t[h]+n;(i!==(null==y?void 0:y.offset)||t.left!==(null==y?void 0:y.rect.left)||t.width!==(null==y?void 0:y.rect.width))&&O({offset:i,rect:t})}},[o,u,h,null==y?void 0:y.offset,null==y?void 0:y.rect.left,null==y?void 0:y.rect.width]);A(function(){C()},[C]);var Z=(0,c.useCallback)(function(){"function"==typeof d.current&&(d.current(),d.current=null),o&&l.current&&(d.current=function(e,t,n,o){void 0===o&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=!0,animationFrame:u=!1}=o,s=i||r?[...E(e)?T(e):e.contextElement?T(e.contextElement):[],...T(t)]:[];s.forEach(e=>{let t=!E(e)&&e.toString().includes("V");i&&(!u||t)&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)});let l,c=null;a&&(c=new ResizeObserver(()=>{n()}),E(e)&&!u&&c.observe(e),E(e)||!e.contextElement||u||c.observe(e.contextElement),c.observe(t));let d=u?F(e):null;return u&&function t(){let o=F(e);d&&(o.x!==d.x||o.y!==d.y||o.width!==d.width||o.height!==d.height)&&n(),d=o,l=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach(e=>{i&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)}),null==(e=c)||e.disconnect(),c=null,u&&cancelAnimationFrame(l)}}(o,l.current,C,{elementResize:"ResizeObserver"in window}))},[o,C]);A(function(){Z()},[Z]);var w=(0,c.useCallback)(function(e){l.current=e,Z()},[Z]);if(!t&&"fixed"!==u||!y)return null;var I=(0,b.tZ)("div",(0,p.Z)({ref:w},j((0,a.Z)((0,a.Z)({},e),{},{offset:y.offset,position:u,rect:y.rect}),"menuPortal",{"menu-portal":!0}),i),n);return(0,b.tZ)(en.Provider,{value:v},t?(0,x.createPortal)(I,t):I)},LoadingMessage:ea,NoOptionsMessage:er,MultiValue:function(e){var t=e.children,n=e.components,o=e.data,i=e.innerProps,r=e.isDisabled,u=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,d=n.Remove;return(0,b.tZ)(l,{data:o,innerProps:(0,a.Z)((0,a.Z)({},j(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":r})),i),selectProps:s},(0,b.tZ)(c,{data:o,innerProps:(0,a.Z)({},j(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),(0,b.tZ)(d,{data:o,innerProps:(0,a.Z)((0,a.Z)({},j(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},u),selectProps:s}))},MultiValueContainer:eO,MultiValueLabel:eO,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({role:"button"},n),t||(0,b.tZ)(ec,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,o=e.isFocused,i=e.isSelected,r=e.innerRef,a=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":o,"option--is-selected":i}),{ref:r,"aria-disabled":n},a),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,o=e.isDisabled,i=e.isRtl;return(0,b.tZ)("div",(0,p.Z)({},j(e,"container",{"--is-disabled":o,"--is-rtl":i}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,o=e.innerProps;return(0,b.tZ)("div",(0,p.Z)({},j(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),o),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,o=e.isMulti,i=e.hasValue;return(0,b.tZ)("div",(0,p.Z)({},j(e,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":i}),n),t)}},eC=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function eZ(e,t){if(e.length!==t.length)return!1;for(var n,o,i=0;i<e.length;i++)if(!((n=e[i])===(o=t[i])||eC(n)&&eC(o)))return!1;return!0}for(var ew={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},eI=function(e){return(0,b.tZ)("span",(0,p.Z)({css:ew},e))},eS={guidance:function(e){var t=e.isSearchable,n=e.isMulti,o=e.isDisabled,i=e.tabSelectsValue;switch(e.context){case"menu":return"Use Up and Down to choose options".concat(o?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,o=void 0===n?"":n,i=e.labels,r=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(o,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(i.length>1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return r?"option ".concat(o," is disabled. Select another option."):"option ".concat(o,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,o=e.options,i=e.label,r=void 0===i?"":i,a=e.selectValue,u=e.isDisabled,s=e.isSelected,l=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(r," focused, ").concat(l(a,n),".");if("menu"===t){var c="".concat(s?"selected":"focused").concat(u?" disabled":"");return"option ".concat(r," ").concat(c,", ").concat(l(o,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},eE=function(e){var t=e.ariaSelection,n=e.focusedOption,o=e.focusedValue,i=e.focusableOptions,r=e.isFocused,u=e.selectValue,s=e.selectProps,l=e.id,d=s.ariaLiveMessages,p=s.getOptionLabel,f=s.inputValue,h=s.isMulti,m=s.isOptionDisabled,v=s.isSearchable,g=s.menuIsOpen,y=s.options,O=s.screenReaderStatus,x=s.tabSelectsValue,C=s["aria-label"],Z=s["aria-live"],w=(0,c.useMemo)(function(){return(0,a.Z)((0,a.Z)({},eS),d||{})},[d]),I=(0,c.useMemo)(function(){var e="";if(t&&w.onChange){var n=t.option,o=t.options,i=t.removedValue,r=t.removedValues,s=t.value,l=i||n||(Array.isArray(s)?null:s),c=l?p(l):"",d=o||r||void 0,f=d?d.map(p):[],h=(0,a.Z)({isDisabled:l&&m(l,u),label:c,labels:f},t);e=w.onChange(h)}return e},[t,w,m,u,p]),S=(0,c.useMemo)(function(){var e="",t=n||o,r=!!(n&&u&&u.includes(n));if(t&&w.onFocus){var a={focused:t,label:p(t),isDisabled:m(t,u),isSelected:r,options:i,context:t===n?"menu":"value",selectValue:u};e=w.onFocus(a)}return e},[n,o,p,m,w,i,u]),E=(0,c.useMemo)(function(){var e="";if(g&&y.length&&w.onFilter){var t=O({count:i.length});e=w.onFilter({inputValue:f,resultsMessage:t})}return e},[i,f,g,w,y,O]),V=(0,c.useMemo)(function(){var e="";if(w.guidance){var t=o?"value":g?"menu":"input";e=w.guidance({"aria-label":C,context:t,isDisabled:n&&m(n,u),isMulti:h,isSearchable:v,tabSelectsValue:x})}return e},[C,n,o,h,m,v,g,w,u,x]),M="".concat(S," ").concat(E," ").concat(V),R=(0,b.tZ)(c.Fragment,null,(0,b.tZ)("span",{id:"aria-selection"},I),(0,b.tZ)("span",{id:"aria-context"},M)),L=(null==t?void 0:t.action)==="initial-input-focus";return(0,b.tZ)(c.Fragment,null,(0,b.tZ)(eI,{id:l},L&&R),(0,b.tZ)(eI,{"aria-live":Z,"aria-atomic":"false","aria-relevant":"additions text"},r&&!L&&R))},eV=[{base:"A",letters:"AⒶA\xc0\xc1\xc2ẦẤẪẨ\xc3ĀĂẰẮẴẲȦǠ\xc4ǞẢ\xc5ǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"\xc6ǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČ\xc7ḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺE\xc8\xc9\xcaỀẾỄỂẼĒḔḖĔĖ\xcbẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾI\xcc\xcd\xceĨĪĬİ\xcfḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃ\xd1ṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄO\xd2\xd3\xd4ỒỐỖỔ\xd5ṌȬṎŌṐṒŎȮȰ\xd6ȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬ\xd8ǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊU\xd9\xda\xdbŨṸŪṺŬ\xdcǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲ\xddŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚ\xe0\xe1\xe2ầấẫẩ\xe3āăằắẵẳȧǡ\xe4ǟả\xe5ǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"\xe6ǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċč\xe7ḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔe\xe8\xe9\xeaềếễểẽēḕḗĕė\xebẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘi\xec\xed\xeeĩīĭ\xefḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹń\xf1ṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞo\xf2\xf3\xf4ồốỗổ\xf5ṍȭṏōṑṓŏȯȱ\xf6ȫỏőǒȍȏơờớỡởợọộǫǭ\xf8ǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢs\xdfśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤu\xf9\xfa\xfbũṹūṻŭ\xfcǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳ\xfdŷỹȳẏ\xffỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],eM=RegExp("["+eV.map(function(e){return e.letters}).join("")+"]","g"),eR={},eL=0;eL<eV.length;eL++)for(var ek=eV[eL],eD=0;eD<ek.letters.length;eD++)eR[ek.letters[eD]]=ek.base;var eP=function(e){return e.replace(eM,function(e){return eR[e]})},eF=function(e,t){void 0===t&&(t=eZ);var n=null;function o(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var r=e.apply(this,o);return n={lastResult:r,lastArgs:o,lastThis:this},r}return o.clear=function(){n=null},o}(eP),eT=function(e){return e.replace(/^\s+|\s+$/g,"")},eA=function(e){return"".concat(e.label," ").concat(e.value)},eH=["innerRef"];function eU(e){var t=e.innerRef,n=ee((0,l.Z)(e,eH),"onExited","in","enter","exit","appear");return(0,b.tZ)("input",(0,p.Z)({ref:t},n,{css:(0,b.iv)({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var ez=function(e){e.preventDefault(),e.stopPropagation()},eN=["boxSizing","height","overflow","paddingRight","position"],eB={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function ej(e){e.preventDefault()}function eW(e){e.stopPropagation()}function eY(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function eG(){return"ontouchstart"in window||navigator.maxTouchPoints}var e_=!!("undefined"!=typeof window&&window.document&&window.document.createElement),eX=0,eq={capture:!1,passive:!1},eK=function(){return document.activeElement&&document.activeElement.blur()},eJ={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function e$(e){var t,n,o,i,r,a,u,s,l,d,p,f,h,m,v,g,y,O,x,C,Z,w,I,S,E=e.children,V=e.lockEnabled,M=e.captureEnabled,R=(n=(t={isEnabled:void 0===M||M,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}).isEnabled,o=t.onBottomArrive,i=t.onBottomLeave,r=t.onTopArrive,a=t.onTopLeave,u=(0,c.useRef)(!1),s=(0,c.useRef)(!1),l=(0,c.useRef)(0),d=(0,c.useRef)(null),p=(0,c.useCallback)(function(e,t){if(null!==d.current){var n=d.current,l=n.scrollTop,c=n.scrollHeight,p=n.clientHeight,f=d.current,h=t>0,m=c-p-l,v=!1;m>t&&u.current&&(i&&i(e),u.current=!1),h&&s.current&&(a&&a(e),s.current=!1),h&&t>m?(o&&!u.current&&o(e),f.scrollTop=c,v=!0,u.current=!0):!h&&-t>l&&(r&&!s.current&&r(e),f.scrollTop=0,v=!0,s.current=!0),v&&ez(e)}},[o,i,r,a]),f=(0,c.useCallback)(function(e){p(e,e.deltaY)},[p]),h=(0,c.useCallback)(function(e){l.current=e.changedTouches[0].clientY},[]),m=(0,c.useCallback)(function(e){var t=l.current-e.changedTouches[0].clientY;p(e,t)},[p]),v=(0,c.useCallback)(function(e){if(e){var t=!!$&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",h,t),e.addEventListener("touchmove",m,t)}},[m,h,f]),g=(0,c.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",h,!1),e.removeEventListener("touchmove",m,!1))},[m,h,f]),(0,c.useEffect)(function(){if(n){var e=d.current;return v(e),function(){g(e)}}},[n,v,g]),function(e){d.current=e}),L=(O=(y={isEnabled:V}).isEnabled,C=void 0===(x=y.accountForScrollbars)||x,Z=(0,c.useRef)({}),w=(0,c.useRef)(null),I=(0,c.useCallback)(function(e){if(e_){var t=document.body,n=t&&t.style;if(C&&eN.forEach(function(e){var t=n&&n[e];Z.current[e]=t}),C&&eX<1){var o=parseInt(Z.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,r=window.innerWidth-i+o||0;Object.keys(eB).forEach(function(e){var t=eB[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(r,"px"))}t&&eG()&&(t.addEventListener("touchmove",ej,eq),e&&(e.addEventListener("touchstart",eY,eq),e.addEventListener("touchmove",eW,eq))),eX+=1}},[C]),S=(0,c.useCallback)(function(e){if(e_){var t=document.body,n=t&&t.style;eX=Math.max(eX-1,0),C&&eX<1&&eN.forEach(function(e){var t=Z.current[e];n&&(n[e]=t)}),t&&eG()&&(t.removeEventListener("touchmove",ej,eq),e&&(e.removeEventListener("touchstart",eY,eq),e.removeEventListener("touchmove",eW,eq)))}},[C]),(0,c.useEffect)(function(){if(O){var e=w.current;return I(e),function(){S(e)}}},[O,I,S]),function(e){w.current=e});return(0,b.tZ)(c.Fragment,null,V&&(0,b.tZ)("div",{onClick:eK,css:eJ}),E(function(e){R(e),L(e)}))}var eQ={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},e0=function(e){var t=e.name,n=e.onFocus;return(0,b.tZ)("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:eQ,value:"",onChange:function(){}})},e1={clearIndicator:ep,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,o=e.isFocused,i=e.theme,r=i.colors,u=i.borderRadius,s=i.spacing;return(0,a.Z)({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?r.neutral5:r.neutral0,borderColor:n?r.neutral10:o?r.primary:r.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(r.primary):void 0,"&:hover":{borderColor:o?r.primary:r.neutral30}})},dropdownIndicator:ep,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,o=n.colors,i=n.spacing;return(0,a.Z)({label:"group",cursor:"default",display:"block"},t?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*i.baseUnit,paddingRight:3*i.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,o=e.theme,i=o.spacing.baseUnit,r=o.colors;return(0,a.Z)({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?r.neutral10:r.neutral20,marginBottom:2*i,marginTop:2*i})},input:function(e,t){var n=e.isDisabled,o=e.value,i=e.theme,r=i.spacing,u=i.colors;return(0,a.Z)((0,a.Z)({visibility:n?"hidden":"visible",transform:o?"translateZ(0)":""},ey),t?{}:{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,color:u.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,o=e.size,i=e.theme,r=i.colors,u=i.spacing.baseUnit;return(0,a.Z)({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?r.neutral60:r.neutral20,padding:2*u})},loadingMessage:ei,menu:function(e,t){var n,o=e.placement,i=e.theme,r=i.borderRadius,u=i.spacing,s=i.colors;return(0,a.Z)((n={label:"menu"},(0,O.Z)(n,o?({bottom:"top",top:"bottom"})[o]:"bottom","100%"),(0,O.Z)(n,"position","absolute"),(0,O.Z)(n,"width","100%"),(0,O.Z)(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:r,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},menuList:function(e,t){var n=e.maxHeight,o=e.theme.spacing.baseUnit;return(0,a.Z)({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:o,paddingTop:o})},menuPortal:function(e){var t=e.rect,n=e.offset,o=e.position;return{left:t.left,position:o,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,o=n.spacing,i=n.borderRadius,r=n.colors;return(0,a.Z)({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:r.neutral10,borderRadius:i/2,margin:o.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,o=n.borderRadius,i=n.colors,r=e.cropWithEllipsis;return(0,a.Z)({overflow:"hidden",textOverflow:r||void 0===r?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:o/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,o=n.spacing,i=n.borderRadius,r=n.colors,u=e.isFocused;return(0,a.Z)({alignItems:"center",display:"flex"},t?{}:{borderRadius:i/2,backgroundColor:u?r.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:r.dangerLight,color:r.danger}})},noOptionsMessage:ei,option:function(e,t){var n=e.isDisabled,o=e.isFocused,i=e.isSelected,r=e.theme,u=r.spacing,s=r.colors;return(0,a.Z)({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:i?s.primary:o?s.primary25:"transparent",color:n?s.neutral20:i?s.neutral0:"inherit",padding:"".concat(2*u.baseUnit,"px ").concat(3*u.baseUnit,"px"),":active":{backgroundColor:n?void 0:i?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,o=n.spacing,i=n.colors;return(0,a.Z)({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:i.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,o=e.theme,i=o.spacing,r=o.colors;return(0,a.Z)({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?r.neutral40:r.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,o=e.isMulti,i=e.hasValue,r=e.selectProps.controlShouldRenderValue;return(0,a.Z)({alignItems:"center",display:o&&i&&r?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},e2={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},e3={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:q(),captureMenuScroll:!q(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=(0,a.Z)({ignoreCase:!0,ignoreAccents:!0,stringify:eA,trim:!0,matchFrom:"any"},void 0),o=n.ignoreCase,i=n.ignoreAccents,r=n.stringify,u=n.trim,s=n.matchFrom,l=u?eT(t):t,c=u?eT(r(e)):r(e);return o&&(l=l.toLowerCase(),c=c.toLowerCase()),i&&(l=eF(l),c=eP(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function e6(e,t,n,o){var i=te(e,t,n),r=tt(e,t,n),a=e9(e,t),u=e7(e,t);return{type:"option",data:t,isDisabled:i,isSelected:r,label:a,value:u,index:o}}function e4(e,t){return e.options.map(function(n,o){if("options"in n){var i=n.options.map(function(n,o){return e6(e,n,t,o)}).filter(function(t){return e8(e,t)});return i.length>0?{type:"group",data:n,options:i,index:o}:void 0}var r=e6(e,n,t,o);return e8(e,r)?r:void 0}).filter(Q)}function e5(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,(0,g.Z)(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function e8(e,t){var n=e.inputValue,o=t.data,i=t.isSelected,r=t.label,a=t.value;return(!to(e)||!i)&&tn(e,{label:r,value:a,data:o},void 0===n?"":n)}var e9=function(e,t){return e.getOptionLabel(t)},e7=function(e,t){return e.getOptionValue(t)};function te(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function tt(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var o=e7(e,t);return n.some(function(t){return e7(e,t)===o})}function tn(e,t,n){return!e.filterOption||e.filterOption(t,n)}var to=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},ti=1,tr=function(e){(0,m.Z)(n,e);var t=(0,v.Z)(n);function n(e){var o;if((0,f.Z)(this,n),(o=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.instancePrefix="",o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.controlRef=null,o.getControlRef=function(e){o.controlRef=e},o.focusedOptionRef=null,o.getFocusedOptionRef=function(e){o.focusedOptionRef=e},o.menuListRef=null,o.getMenuListRef=function(e){o.menuListRef=e},o.inputRef=null,o.getInputRef=function(e){o.inputRef=e},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(e,t){var n=o.props,i=n.onChange,r=n.name;t.name=r,o.ariaOnChange(e,t),i(e,t)},o.setValue=function(e,t,n){var i=o.props,r=i.closeMenuOnSelect,a=i.isMulti,u=i.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:u}),r&&(o.setState({inputIsHiddenAfterUpdate:!a}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(e,{action:t,option:n})},o.selectOption=function(e){var t=o.props,n=t.blurInputOnSelect,i=t.isMulti,r=t.name,a=o.state.selectValue,u=i&&o.isOptionSelected(e,a),s=o.isOptionDisabled(e,a);if(u){var l=o.getOptionValue(e);o.setValue(a.filter(function(e){return o.getOptionValue(e)!==l}),"deselect-option",e)}else if(s){o.ariaOnChange(e,{action:"select-option",option:e,name:r});return}else i?o.setValue([].concat((0,g.Z)(a),[e]),"select-option",e):o.setValue(e,"select-option");n&&o.blurInput()},o.removeValue=function(e){var t,n=o.props.isMulti,i=o.state.selectValue,r=o.getOptionValue(e),a=i.filter(function(e){return o.getOptionValue(e)!==r}),u=(t=a[0]||null,n?a:t);o.onChange(u,{action:"remove-value",removedValue:e}),o.focusInput()},o.clearValue=function(){var e,t,n=o.state.selectValue;o.onChange((e=o.props.isMulti,t=[],e?t:null),{action:"clear",removedValues:n})},o.popValue=function(){var e,t=o.props.isMulti,n=o.state.selectValue,i=n[n.length-1],r=n.slice(0,n.length-1),a=(e=r[0]||null,t?r:e);o.onChange(a,{action:"pop-value",removedValue:i})},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return z.apply(void 0,[o.props.classNamePrefix].concat(t))},o.getOptionLabel=function(e){return e9(o.props,e)},o.getOptionValue=function(e){return e7(o.props,e)},o.getStyles=function(e,t){var n=o.props.unstyled,i=e1[e](t,n);i.boxSizing="border-box";var r=o.props.styles[e];return r?r(i,t):i},o.getClassNames=function(e,t){var n,i;return null===(n=(i=o.props.classNames)[e])||void 0===n?void 0:n.call(i,t)},o.getElementId=function(e){return"".concat(o.instancePrefix,"-").concat(e)},o.getComponents=function(){var e;return e=o.props,(0,a.Z)((0,a.Z)({},ex),e.components)},o.buildCategorizedOptions=function(){return e4(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return e5(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(e,t){o.setState({ariaSelection:(0,a.Z)({value:e},t)})},o.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(e){o.blockOptionHover=!1},o.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&o.onMenuClose():t&&o.openMenu("first"):(t&&(o.openAfterFocus=!0),o.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},o.onDropdownIndicatorMouseDown=function(e){if((!e||"mousedown"!==e.type||0===e.button)&&!o.props.isDisabled){var t=o.props,n=t.isMulti,i=t.menuIsOpen;o.focusInput(),i?(o.setState({inputIsHiddenAfterUpdate:!n}),o.onMenuClose()):o.openMenu("first"),e.preventDefault()}},o.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(o.clearValue(),e.preventDefault(),o.openAfterFocus=!1,"touchend"===e.type?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(e){"boolean"==typeof o.props.closeMenuOnScroll?e.target instanceof HTMLElement&&W(e.target)&&o.props.onMenuClose():"function"==typeof o.props.closeMenuOnScroll&&o.props.closeMenuOnScroll(e)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(o.initialTouchX=n.clientX,o.initialTouchY=n.clientY,o.userIsDragging=!1)},o.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var i=Math.abs(n.clientX-o.initialTouchX),r=Math.abs(n.clientY-o.initialTouchY);o.userIsDragging=i>5||r>5}},o.onTouchEnd=function(e){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(e.target)&&o.menuListRef&&!o.menuListRef.contains(e.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(e){o.userIsDragging||o.onControlMouseDown(e)},o.onClearIndicatorTouchEnd=function(e){o.userIsDragging||o.onClearIndicatorMouseDown(e)},o.onDropdownIndicatorTouchEnd=function(e){o.userIsDragging||o.onDropdownIndicatorMouseDown(e)},o.handleInputChange=function(e){var t=o.props.inputValue,n=e.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(n,{action:"input-change",prevInputValue:t}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(e){o.props.onFocus&&o.props.onFocus(e),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(e){var t=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(e),o.onInputChange("",{action:"input-blur",prevInputValue:t}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(e){o.blockOptionHover||o.state.focusedOption===e||o.setState({focusedOption:e})},o.shouldHideSelectedOptions=function(){return to(o.props)},o.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),o.focus()},o.onKeyDown=function(e){var t=o.props,n=t.isMulti,i=t.backspaceRemovesValue,r=t.escapeClearsValue,a=t.inputValue,u=t.isClearable,s=t.isDisabled,l=t.menuIsOpen,c=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,f=o.state,h=f.focusedOption,m=f.focusedValue,v=f.selectValue;if(!s){if("function"==typeof c&&(c(e),e.defaultPrevented))return;switch(o.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;o.focusValue("previous");break;case"ArrowRight":if(!n||a)return;o.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)o.removeValue(m);else{if(!i)return;n?o.popValue():u&&o.clearValue()}break;case"Tab":if(o.isComposing||e.shiftKey||!l||!d||!h||p&&o.isOptionSelected(h,v))return;o.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(l){if(!h||o.isComposing)return;o.selectOption(h);break}return;case"Escape":l?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:a}),o.onMenuClose()):u&&r&&o.clearValue();break;case" ":if(a)return;if(!l){o.openMenu("first");break}if(!h)return;o.selectOption(h);break;case"ArrowUp":l?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":l?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!l)return;o.focusOption("pageup");break;case"PageDown":if(!l)return;o.focusOption("pagedown");break;case"Home":if(!l)return;o.focusOption("first");break;case"End":if(!l)return;o.focusOption("last");break;default:return}e.preventDefault()}},o.instancePrefix="react-select-"+(o.props.instanceId||++ti),o.state.selectValue=N(e.value),e.menuIsOpen&&o.state.selectValue.length){var i=o.buildFocusableOptions(),r=i.indexOf(o.state.selectValue[0]);o.state.focusedOption=i[r]}return o}return(0,h.Z)(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&X(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,o=t.menuIsOpen,i=this.state.isFocused;(i&&!n&&e.isDisabled||i&&o&&!e.menuIsOpen)&&this.focusInput(),i&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):i||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(X(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,o=n.selectValue,i=n.isFocused,r=this.buildFocusableOptions(),a="first"===e?0:r.length-1;if(!this.props.isMulti){var u=r.indexOf(o[0]);u>-1&&(a=u)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:r[a]},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,o=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var i=n.indexOf(o);o||(i=-1);var r=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===i?0:-1===i?r:i-1;break;case"next":i>-1&&i<r&&(a=i+1)}this.setState({inputIsHidden:-1!==a,focusedValue:n[a]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,o=this.getFocusableOptions();if(o.length){var i=0,r=o.indexOf(n);n||(r=-1),"up"===e?i=r>0?r-1:o.length-1:"down"===e?i=(r+1)%o.length:"pageup"===e?(i=r-t)<0&&(i=0):"pagedown"===e?(i=r+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(e2):(0,a.Z)((0,a.Z)({},e2),this.props.theme):e2}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,o=this.getClassNames,i=this.getValue,r=this.selectOption,a=this.setValue,u=this.props,s=u.isMulti,l=u.isRtl,c=u.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:o,getValue:i,hasValue:this.hasValue(),isMulti:s,isRtl:l,options:c,selectOption:r,selectProps:u,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return te(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return tt(this.props,e,t)}},{key:"filterOption",value:function(e,t){return tn(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"!=typeof this.props.formatOptionLabel)return this.getOptionLabel(e);var n=this.props.inputValue,o=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:o})}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,o=e.inputId,i=e.inputValue,r=e.tabIndex,u=e.form,s=e.menuIsOpen,l=e.required,d=this.getComponents().Input,f=this.state,h=f.inputIsHidden,m=f.ariaSelection,v=this.commonProps,g=o||this.getElementId("input"),b=(0,a.Z)((0,a.Z)((0,a.Z)({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":l,role:"combobox"},s&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?(null==m?void 0:m.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?c.createElement(d,(0,p.Z)({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:t,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:u,type:"text",value:i},b)):c.createElement(eU,(0,p.Z)({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:U,onFocus:this.onInputFocus,disabled:t,tabIndex:r,inputMode:"none",form:u,value:""},b))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,o=t.MultiValueContainer,i=t.MultiValueLabel,r=t.MultiValueRemove,a=t.SingleValue,u=t.Placeholder,s=this.commonProps,l=this.props,d=l.controlShouldRenderValue,f=l.isDisabled,h=l.isMulti,m=l.inputValue,v=l.placeholder,g=this.state,b=g.selectValue,y=g.focusedValue,O=g.isFocused;if(!this.hasValue()||!d)return m?null:c.createElement(u,(0,p.Z)({},s,{key:"placeholder",isDisabled:f,isFocused:O,innerProps:{id:this.getElementId("placeholder")}}),v);if(h)return b.map(function(t,a){var u=t===y,l="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return c.createElement(n,(0,p.Z)({},s,{components:{Container:o,Label:i,Remove:r},isFocused:u,isDisabled:f,key:l,index:a,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var x=b[0];return c.createElement(a,(0,p.Z)({},s,{data:x,isDisabled:f}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,i=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||o||!this.hasValue()||i)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,(0,p.Z)({},t,{innerProps:a,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,i=n.isLoading,r=this.state.isFocused;return e&&i?c.createElement(e,(0,p.Z)({},t,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var o=this.commonProps,i=this.props.isDisabled,r=this.state.isFocused;return c.createElement(n,(0,p.Z)({},o,{isDisabled:i,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,o=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,(0,p.Z)({},t,{innerProps:i,isDisabled:n,isFocused:o}))}},{key:"renderMenu",value:function(){var e,t=this,n=this.getComponents(),o=n.Group,i=n.GroupHeading,r=n.Menu,a=n.MenuList,u=n.MenuPortal,s=n.LoadingMessage,l=n.NoOptionsMessage,d=n.Option,f=this.commonProps,h=this.state.focusedOption,m=this.props,v=m.captureMenuScroll,g=m.inputValue,b=m.isLoading,y=m.loadingMessage,O=m.minMenuHeight,x=m.maxMenuHeight,C=m.menuIsOpen,Z=m.menuPlacement,w=m.menuPosition,I=m.menuPortalTarget,S=m.menuShouldBlockScroll,E=m.menuShouldScrollIntoView,V=m.noOptionsMessage,M=m.onMenuScrollToTop,R=m.onMenuScrollToBottom;if(!C)return null;var L=function(e,n){var o=e.type,i=e.data,r=e.isDisabled,a=e.isSelected,u=e.label,s=e.value,l=h===i,m=r?void 0:function(){return t.onOptionHover(i)},v=r?void 0:function(){return t.selectOption(i)},g="".concat(t.getElementId("option"),"-").concat(n);return c.createElement(d,(0,p.Z)({},f,{innerProps:{id:g,onClick:v,onMouseMove:m,onMouseOver:m,tabIndex:-1},data:i,isDisabled:r,isSelected:a,key:g,label:u,type:o,value:s,isFocused:l,innerRef:l?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(e.data,"menu"))};if(this.hasOptions())e=this.getCategorizedOptions().map(function(e){if("group"===e.type){var n=e.data,r=e.options,a=e.index,u="".concat(t.getElementId("group"),"-").concat(a),s="".concat(u,"-heading");return c.createElement(o,(0,p.Z)({},f,{key:u,data:n,options:r,Heading:i,headingProps:{id:s,data:e.data},label:t.formatGroupLabel(e.data)}),e.options.map(function(e){return L(e,"".concat(a,"-").concat(e.index))}))}if("option"===e.type)return L(e,"".concat(e.index))});else if(b){var k=y({inputValue:g});if(null===k)return null;e=c.createElement(s,f,k)}else{var D=V({inputValue:g});if(null===D)return null;e=c.createElement(l,f,D)}var P={minMenuHeight:O,maxMenuHeight:x,menuPlacement:Z,menuPosition:w,menuShouldScrollIntoView:E},F=c.createElement(eo,(0,p.Z)({},f,P),function(n){var o=n.ref,i=n.placerProps,u=i.placement,s=i.maxHeight;return c.createElement(r,(0,p.Z)({},f,P,{innerRef:o,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:b,placement:u}),c.createElement(e$,{captureEnabled:v,onTopArrive:M,onBottomArrive:R,lockEnabled:S},function(n){return c.createElement(a,(0,p.Z)({},f,{innerRef:function(e){t.getMenuListRef(e),n(e)},isLoading:b,maxHeight:s,focusedOption:h}),e)}))});return I||"fixed"===w?c.createElement(u,(0,p.Z)({},f,{appendTo:I,controlElement:this.controlRef,menuPlacement:Z,menuPosition:w}),F):F}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,o=t.isDisabled,i=t.isMulti,r=t.name,a=t.required,u=this.state.selectValue;if(a&&!this.hasValue()&&!o)return c.createElement(e0,{name:r,onFocus:this.onValueInputFocus});if(r&&!o){if(i){if(n){var s=u.map(function(t){return e.getOptionValue(t)}).join(n);return c.createElement("input",{name:r,type:"hidden",value:s})}var l=u.length>0?u.map(function(t,n){return c.createElement("input",{key:"i-".concat(n),name:r,type:"hidden",value:e.getOptionValue(t)})}):c.createElement("input",{name:r,type:"hidden",value:""});return c.createElement("div",null,l)}var d=u[0]?this.getOptionValue(u[0]):"";return c.createElement("input",{name:r,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,o=t.focusedOption,i=t.focusedValue,r=t.isFocused,a=t.selectValue,u=this.getFocusableOptions();return c.createElement(eE,(0,p.Z)({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:o,focusedValue:i,isFocused:r,selectValue:a,focusableOptions:u}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,o=e.SelectContainer,i=e.ValueContainer,r=this.props,a=r.className,u=r.id,s=r.isDisabled,l=r.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return c.createElement(o,(0,p.Z)({},f,{className:a,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:d}),this.renderLiveRegion(),c.createElement(t,(0,p.Z)({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:d,menuIsOpen:l}),c.createElement(i,(0,p.Z)({},f,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),c.createElement(n,(0,p.Z)({},f,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o=t.prevProps,i=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,u=t.ariaSelection,s=t.isFocused,l=t.prevWasFocused,c=e.options,d=e.value,p=e.menuIsOpen,f=e.inputValue,h=e.isMulti,m=N(d),v={};if(o&&(d!==o.value||c!==o.options||p!==o.menuIsOpen||f!==o.inputValue)){var g,b=p?e5(e4(e,m)):[],y=i?function(e,t){var n=e.focusedValue,o=e.selectValue.indexOf(n);if(o>-1){if(t.indexOf(n)>-1)return n;if(o<t.length)return t[o]}return null}(t,m):null;v={selectValue:m,focusedOption:(g=t.focusedOption)&&b.indexOf(g)>-1?g:b[0],focusedValue:y,clearFocusValueOnUpdate:!1}}var O=null!=r&&e!==o?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},x=u,C=s&&l;return s&&!C&&(x={value:(n=m[0]||null,h?m:n),options:m,action:"initial-input-focus"},C=!l),(null==u?void 0:u.action)==="initial-input-focus"&&(x=null),(0,a.Z)((0,a.Z)((0,a.Z)({},v),O),{},{prevProps:e,ariaSelection:x,prevWasFocused:C})}}]),n}(c.Component);tr.defaultProps=e3,n(2107);var ta=(0,c.forwardRef)(function(e,t){var n,o,i,r,u,f,h,m,v,g,b,y,O,x,C,Z,w,I,S,E,V,M,R,L,k,D,P,F=(n=e.defaultInputValue,o=e.defaultMenuIsOpen,i=e.defaultValue,r=e.inputValue,u=e.menuIsOpen,f=e.onChange,h=e.onInputChange,m=e.onMenuClose,v=e.onMenuOpen,g=e.value,b=(0,l.Z)(e,d),O=(y=s((0,c.useState)(void 0!==r?r:void 0===n?"":n),2))[0],x=y[1],Z=(C=s((0,c.useState)(void 0!==u?u:void 0!==o&&o),2))[0],w=C[1],S=(I=s((0,c.useState)(void 0!==g?g:void 0===i?null:i),2))[0],E=I[1],V=(0,c.useCallback)(function(e,t){"function"==typeof f&&f(e,t),E(e)},[f]),M=(0,c.useCallback)(function(e,t){var n;"function"==typeof h&&(n=h(e,t)),x(void 0!==n?n:e)},[h]),R=(0,c.useCallback)(function(){"function"==typeof v&&v(),w(!0)},[v]),L=(0,c.useCallback)(function(){"function"==typeof m&&m(),w(!1)},[m]),k=void 0!==r?r:O,D=void 0!==u?u:Z,P=void 0!==g?g:S,(0,a.Z)((0,a.Z)({},b),{},{inputValue:k,menuIsOpen:D,onChange:V,onInputChange:M,onMenuClose:L,onMenuOpen:R,value:P}));return c.createElement(tr,(0,p.Z)({ref:t},F))})},926:function(e,t,n){"use strict";function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}n.d(t,{Z:function(){return o}})},9249:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}n.d(t,{Z:function(){return o}})},87371:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var o=n(32802);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,o.Z)(i.key),i)}}function r(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var o=n(95058),i=n(70352),r=n(86522),a=n(80753);function u(e){var t=(0,i.Z)();return function(){var n,i=(0,o.Z)(e);return n=t?Reflect.construct(i,arguments,(0,o.Z)(this).constructor):i.apply(this,arguments),function(e,t){if(t&&("object"===(0,r.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return(0,a.Z)(e)}(this,n)}}},45754:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var o=n(88960);function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,o.Z)(e,t)}},59740:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var o=n(31461);function i(e,t){if(null==e)return{};var n,i,r=(0,o.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}},51171:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var o=n(926),i=n(59147);function r(e){return function(e){if(Array.isArray(e))return(0,o.Z)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,i.Z)(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},59147:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var o=n(926);function i(e,t){if(e){if("string"==typeof e)return(0,o.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,o.Z)(e,t)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[484],{40484:function(e,t,n){n.d(t,{Eh:function(){return ti},VY:function(){return tr},h_:function(){return tn},fC:function(){return te},xz:function(){return tt}});var r,i,o=n(2784),l=n(17998),a=n(92211),s=n(87695),c=n(62656);function u(e){return e.split("-")[1]}function f(e){return"y"===e?"height":"width"}function d(e){return e.split("-")[0]}function p(e){return["top","bottom"].includes(d(e))?"x":"y"}function h(e,t,n){let r,{reference:i,floating:o}=e,l=i.x+i.width/2-o.width/2,a=i.y+i.height/2-o.height/2,s=p(t),c=f(s),h=i[c]/2-o[c]/2,m="x"===s;switch(d(t)){case"top":r={x:l,y:i.y-o.height};break;case"bottom":r={x:l,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:a};break;case"left":r={x:i.x-o.width,y:a};break;default:r={x:i.x,y:i.y}}switch(u(t)){case"start":r[s]-=h*(n&&m?-1:1);break;case"end":r[s]+=h*(n&&m?-1:1)}return r}let m=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=o.filter(Boolean),s=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=h(c,r,s),d=r,p={},m=0;for(let n=0;n<a.length;n++){let{name:o,fn:g}=a[n],{x:y,y:x,data:w,reset:v}=await g({x:u,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=y?y:u,f=null!=x?x:f,p={...p,[o]:{...p[o],...w}},v&&m<=50&&(m++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(c=!0===v.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):v.rects),{x:u,y:f}=h(c,d,s)),n=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:p}};function g(e,t){return"function"==typeof e?e(t):e}function y(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function x(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function w(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=g(t,e),h=y(p),m=a[d?"floating"===f?"reference":"floating":f],w=x(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===f?{...l.floating,x:r,y:i}:l.reference,b=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),E=await (null==o.isElement?void 0:o.isElement(b))&&await (null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},R=x(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:s}):v);return{top:(w.top-R.top+h.top)/E.y,bottom:(R.bottom-w.bottom+h.bottom)/E.y,left:(w.left-R.left+h.left)/E.x,right:(R.right-w.right+h.right)/E.x}}let v=Math.min,b=Math.max,E=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:o,platform:l,elements:a}=t,{element:s,padding:c=0}=g(e,t)||{};if(null==s)return{};let d=y(c),h={x:n,y:r},m=p(i),x=f(m),w=await l.getDimensions(s),E="y"===m,R=E?"clientHeight":"clientWidth",C=o.reference[x]+o.reference[m]-h[m]-o.floating[x],P=h[m]-o.reference[m],S=await (null==l.getOffsetParent?void 0:l.getOffsetParent(s)),L=S?S[R]:0;L&&await (null==l.isElement?void 0:l.isElement(S))||(L=a.floating[R]||o.floating[x]);let A=L/2-w[x]/2-1,T=v(d[E?"top":"left"],A),O=v(d[E?"bottom":"right"],A),D=L-w[x]-O,k=L/2-w[x]/2+(C/2-P/2),W=b(T,v(k,D)),H=null!=u(i)&&k!=W&&o.reference[x]/2-(k<T?T:O)-w[x]/2<0?k<T?T-k:D-k:0;return{[m]:h[m]-H,data:{[m]:W,centerOffset:k-W+H}}}}),R=["top","right","bottom","left"],C=(R.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function P(e){return e.replace(/left|right|bottom|top/g,e=>C[e])}let S={start:"end",end:"start"};function L(e){return e.replace(/start|end/g,e=>S[e])}function A(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function T(e){return R.some(t=>e[t]>=0)}function O(e){return"x"===e?"y":"x"}function D(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function k(e){return D(e).getComputedStyle(e)}function W(e){return e instanceof D(e).Node}function H(e){return W(e)?(e.nodeName||"").toLowerCase():"#document"}function j(e){return e instanceof D(e).HTMLElement}function M(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}function F(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=k(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function N(e){let t=z(),n=k(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function z(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function B(e){return["html","body","#document"].includes(H(e))}let V=Math.min,$=Math.max,_=Math.round,I=Math.floor,Y=e=>({x:e,y:e});function X(e){let t=k(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=j(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=_(n)!==o||_(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function U(e){return e instanceof D(e).Element}function q(e){return U(e)?e:e.contextElement}function K(e){let t=q(e);if(!j(t))return Y(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=X(t),l=(o?_(n.width):n.width)/r,a=(o?_(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let G=Y(0);function J(e){let t=D(e);return z()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:G}function Q(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=q(e),a=Y(1);t&&(r?U(r)&&(a=K(r)):a=K(e));let s=(void 0===(i=n)&&(i=!1),!(!r||i&&r!==D(l))&&i)?J(l):Y(0),c=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(l){let e=D(l),t=r&&U(r)?D(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=K(n),t=n.getBoundingClientRect(),r=getComputedStyle(n),i=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,f*=e.x,d*=e.y,c+=i,u+=o,n=D(n).frameElement}}return x({width:f,height:d,x:c,y:u})}function Z(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ee(e){return((W(e)?e.ownerDocument:e.document)||window.document).documentElement}function et(e){return Q(ee(e)).left+Z(e).scrollLeft}function en(e){if("html"===H(e))return e;let t=e.assignedSlot||e.parentNode||M(e)&&e.host||ee(e);return M(t)?t.host:t}function er(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=en(t);return B(n)?t.ownerDocument?t.ownerDocument.body:t.body:j(n)&&F(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=D(r);return i?t.concat(o,o.visualViewport||[],F(r)?r:[]):t.concat(r,er(r))}function ei(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=D(e),r=ee(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,s=0;if(i){o=i.width,l=i.height;let e=z();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,s=i.offsetTop)}return{width:o,height:l,x:a,y:s}}(e,n);else if("document"===t)r=function(e){let t=ee(e),n=Z(e),r=e.ownerDocument.body,i=$(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=$(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),l=-n.scrollLeft+et(e),a=-n.scrollTop;return"rtl"===k(r).direction&&(l+=$(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:a}}(ee(e));else if(U(t))r=function(e,t){let n=Q(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=j(e)?K(e):Y(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{let n=J(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return x(r)}function eo(e,t){return j(e)&&"fixed"!==k(e).position?t?t(e):e.offsetParent:null}function el(e,t){let n=D(e);if(!j(e))return n;let r=eo(e,t);for(;r&&["table","td","th"].includes(H(r))&&"static"===k(r).position;)r=eo(r,t);return r&&("html"===H(r)||"body"===H(r)&&"static"===k(r).position&&!N(r))?n:r||function(e){let t=en(e);for(;j(t)&&!B(t);){if(N(t))return t;t=en(t)}return null}(e)||n}let ea={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=j(n),o=ee(n);if(n===o)return t;let l={scrollLeft:0,scrollTop:0},a=Y(1),s=Y(0);if((i||!i&&"fixed"!==r)&&(("body"!==H(n)||F(o))&&(l=Z(n)),j(n))){let e=Q(n);a=K(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+s.x,y:t.y*a.y-l.scrollTop*a.y+s.y}},getDocumentElement:ee,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?function(e,t){let n=t.get(e);if(n)return n;let r=er(e).filter(e=>U(e)&&"body"!==H(e)),i=null,o="fixed"===k(e).position,l=o?en(e):e;for(;U(l)&&!B(l);){let t=k(l),n=N(l);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||F(l)&&!n&&function e(t,n){let r=en(t);return!(r===n||!U(r)||B(r))&&("fixed"===k(r).position||e(r,n))}(e,l))?r=r.filter(e=>e!==l):i=t,l=en(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=o[0],a=o.reduce((e,n)=>{let r=ei(t,n,i);return e.top=$(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=$(r.left,e.left),e},ei(t,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:el,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||el,o=this.getDimensions;return{reference:function(e,t,n){let r=j(t),i=ee(t),o="fixed"===n,l=Q(e,!0,o,t),a={scrollLeft:0,scrollTop:0},s=Y(0);if(r||!r&&!o){if(("body"!==H(t)||F(i))&&(a=Z(t)),j(t)){let e=Q(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=et(i))}return{x:l.left+a.scrollLeft-s.x,y:l.top+a.scrollTop-s.y,width:l.width,height:l.height}}(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return X(e)},getScale:K,isElement:U,isRTL:function(e){return"rtl"===getComputedStyle(e).direction}},es=(e,t,n)=>{let r=new Map,i={platform:ea,...n},o={...i.platform,_c:r};return m(e,t,{...i,platform:o})};var ec=n(28316);let eu=e=>({name:"arrow",options:e,fn(t){let{element:n,padding:r}="function"==typeof e?e(t):e;if(n&&({}).hasOwnProperty.call(n,"current")){if(null!=n.current)return E({element:n.current,padding:r}).fn(t)}else if(n)return E({element:n,padding:r}).fn(t);return{}}});var ef="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function ed(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!ed(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!ed(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ep(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eh(e,t){let n=ep(e);return Math.round(t*n)/n}function em(e){let t=o.useRef(e);return ef(()=>{t.current=e}),t}var eg=n(72714),ey=n(52322),ex=o.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,ey.jsx)(eg.WV.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,ey.jsx)("polygon",{points:"0,0 30,0 15,10"})})});ex.displayName="Arrow";var ew=n(27757),ev=n(61644),eb="Popper",[eE,eR]=(0,a.b)(eb),[eC,eP]=eE(eb),eS=e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null);return(0,ey.jsx)(eC,{scope:t,anchor:r,onAnchorChange:i,children:n})};eS.displayName=eb;var eL="PopperAnchor",eA=o.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,l=eP(eL,n),a=o.useRef(null),s=(0,c.e)(t,a);return o.useEffect(()=>{l.onAnchorChange(r?.current||a.current)}),r?null:(0,ey.jsx)(eg.WV.div,{...i,ref:s})});eA.displayName=eL;var eT="PopperContent",[eO,eD]=eE(eT),ek=o.forwardRef((e,t)=>{var n,r,i,l,a,s;let{__scopePopper:h,side:m="bottom",sideOffset:y=0,align:x="center",alignOffset:E=0,arrowPadding:R=0,avoidCollisions:C=!0,collisionBoundary:S=[],collisionPadding:D=0,sticky:k="partial",hideWhenDetached:W=!1,updatePositionStrategy:H="optimized",onPlaced:j,...M}=e,F=eP(eT,h),[N,z]=o.useState(null),B=(0,c.e)(t,e=>z(e)),[_,Y]=o.useState(null),X=function(e){let[t,n]=o.useState(void 0);return(0,ev.b)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(_),U=X?.width??0,K=X?.height??0,G="number"==typeof D?D:{top:0,right:0,bottom:0,left:0,...D},J=Array.isArray(S)?S:[S],Z=J.length>0,et={padding:G,boundary:J.filter(eM),altBoundary:Z},{refs:en,floatingStyles:ei,placement:eo,isPositioned:el,middlewareData:ea}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:a}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[f,d]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);ed(p,r)||h(r);let[m,g]=o.useState(null),[y,x]=o.useState(null),w=o.useCallback(e=>{e!=R.current&&(R.current=e,g(e))},[g]),v=o.useCallback(e=>{e!==C.current&&(C.current=e,x(e))},[x]),b=l||m,E=a||y,R=o.useRef(null),C=o.useRef(null),P=o.useRef(f),S=em(c),L=em(i),A=o.useCallback(()=>{if(!R.current||!C.current)return;let e={placement:t,strategy:n,middleware:p};L.current&&(e.platform=L.current),es(R.current,C.current,e).then(e=>{let t={...e,isPositioned:!0};T.current&&!ed(P.current,t)&&(P.current=t,ec.flushSync(()=>{d(t)}))})},[p,t,n,L]);ef(()=>{!1===u&&P.current.isPositioned&&(P.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let T=o.useRef(!1);ef(()=>(T.current=!0,()=>{T.current=!1}),[]),ef(()=>{if(b&&(R.current=b),E&&(C.current=E),b&&E){if(S.current)return S.current(b,E,A);A()}},[b,E,A,S]);let O=o.useMemo(()=>({reference:R,floating:C,setReference:w,setFloating:v}),[w,v]),D=o.useMemo(()=>({reference:b,floating:E}),[b,E]),k=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eh(D.floating,f.x),r=eh(D.floating,f.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...ep(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,D.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:A,refs:O,elements:D,floatingStyles:k}),[f,A,O,D,k])}({strategy:"fixed",placement:m+("center"!==x?"-"+x:""),whileElementsMounted:(...e)=>(function(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=q(e),u=i||o?[...c?er(c):[],...er(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});let f=c&&a?function(e,t){let n,r=null,i=ee(e);function o(){clearTimeout(n),r&&r.disconnect(),r=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),o();let{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;let p={rootMargin:-I(u)+"px "+-I(i.clientWidth-(c+f))+"px "+-I(i.clientHeight-(u+d))+"px "+-I(c)+"px",threshold:$(0,V(1,s))||1},h=!0;function m(e){let t=e[0].intersectionRatio;if(t!==s){if(!h)return l();t?l(!1,t):n=setTimeout(()=>{l(!1,1e-7)},100)}h=!1}try{r=new IntersectionObserver(m,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(m,p)}r.observe(e)}(!0),o}(c,n):null,d,p=-1,h=null;l&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{h&&h.observe(t)})),n()}),c&&!s&&h.observe(c),h.observe(t));let m=s?Q(e):null;return s&&function t(){let r=Q(e);m&&(r.x!==m.x||r.y!==m.y||r.width!==m.width||r.height!==m.height)&&n(),m=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),f&&f(),h&&h.disconnect(),h=null,s&&cancelAnimationFrame(d)}})(...e,{animationFrame:"always"===H}),elements:{reference:F.anchor},middleware:[{name:"offset",options:n={mainAxis:y+K,alignmentAxis:E},async fn(e){let{x:t,y:r}=e,i=await async function(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=d(n),a=u(n),s="x"===p(n),c=["left","top"].includes(l)?-1:1,f=o&&s?-1:1,h=g(t,e),{mainAxis:m,crossAxis:y,alignmentAxis:x}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&"number"==typeof x&&(y="end"===a?-1*x:x),s?{x:y*f,y:m*c}:{x:m*c,y:y*f}}(e,n);return{x:t+i.x,y:r+i.y,data:i}}},C&&{name:"shift",options:i={mainAxis:!0,crossAxis:!1,limiter:"partial"===k?(void 0===r&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:i,rects:o,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=g(r,e),u={x:t,y:n},f=p(i),h=O(f),m=u[f],y=u[h],x=g(a,e),w="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){let e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+w.mainAxis,n=o.reference[f]+o.reference[e]-w.mainAxis;m<t?m=t:m>n&&(m=n)}if(c){var v,b;let e="y"===f?"width":"height",t=["top","left"].includes(d(i)),n=o.reference[h]-o.floating[e]+(t&&(null==(v=l.offset)?void 0:v[h])||0)+(t?0:w.crossAxis),r=o.reference[h]+o.reference[e]+(t?0:(null==(b=l.offset)?void 0:b[h])||0)-(t?w.crossAxis:0);y<n?y=n:y>r&&(y=r)}return{[f]:m,[h]:y}}}):void 0,...et},async fn(e){let{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=g(i,e),c={x:t,y:n},u=await w(e,s),f=p(d(r)),h=O(f),m=c[f],y=c[h];if(o){let e="y"===f?"bottom":"right";m=b(m+u["y"===f?"top":"left"],v(m,m-u[e]))}if(l){let e="y"===h?"bottom":"right";y=b(y+u["y"===h?"top":"left"],v(y,y-u[e]))}let x=a.fn({...e,[f]:m,[h]:y});return{...x,data:{x:x.x-t,y:x.y-n}}}},C&&{name:"flip",options:l={...et},async fn(e){var t,n,r,i;let{placement:o,middlewareData:a,rects:s,initialPlacement:c,platform:h,elements:m}=e,{mainAxis:y=!0,crossAxis:x=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:R=!0,...C}=g(l,e),S=d(o),A=d(c)===c,T=await (null==h.isRTL?void 0:h.isRTL(m.floating)),O=v||(A||!R?[P(c)]:function(e){let t=P(e);return[L(e),t,L(t)]}(c));v||"none"===E||O.push(...function(e,t,n,r){let i=u(e),o=function(e,t,n){let r=["left","right"],i=["right","left"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?["top","bottom"]:["bottom","top"];default:return[]}}(d(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(L)))),o}(c,R,E,T));let D=[c,...O],k=await w(e,C),W=[],H=(null==(t=a.flip)?void 0:t.overflows)||[];if(y&&W.push(k[S]),x){let{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);let r=u(e),i=p(e),o=f(i),l="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=P(l)),{main:l,cross:P(l)}}(o,s,T);W.push(k[e],k[t])}if(H=[...H,{placement:o,overflows:W}],!W.every(e=>e<=0)){let e=((null==(n=a.flip)?void 0:n.index)||0)+1,t=D[e];if(t)return{data:{index:e,overflows:H},reset:{placement:t}};let l=null==(r=H.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:r.placement;if(!l)switch(b){case"bestFit":{let e=null==(i=H.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(l=e);break}case"initialPlacement":l=c}if(o!==l)return{reset:{placement:l}}}return{}}},{name:"size",options:a={...et,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:o}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${i}px`),l.setProperty("--radix-popper-anchor-height",`${o}px`)}},async fn(e){let t,n;let{placement:r,rects:i,platform:o,elements:l}=e,{apply:s=()=>{},...c}=g(a,e),f=await w(e,c),h=d(r),m=u(r),y="x"===p(r),{width:x,height:E}=i.floating;"top"===h||"bottom"===h?(t=h,n=m===(await (null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(n=h,t="end"===m?"top":"bottom");let R=E-f[t],C=x-f[n],P=!e.middlewareData.shift,S=R,L=C;if(y){let e=x-f.left-f.right;L=m||P?v(C,e):e}else{let e=E-f.top-f.bottom;S=m||P?v(R,e):e}if(P&&!m){let e=b(f.left,0),t=b(f.right,0),n=b(f.top,0),r=b(f.bottom,0);y?L=x-2*(0!==e||0!==t?e+t:b(f.left,f.right)):S=E-2*(0!==n||0!==r?n+r:b(f.top,f.bottom))}await s({...e,availableWidth:L,availableHeight:S});let A=await o.getDimensions(l.floating);return x!==A.width||E!==A.height?{reset:{rects:!0}}:{}}},_&&eu({element:_,padding:R}),eF({arrowWidth:U,arrowHeight:K}),W&&{name:"hide",options:s={strategy:"referenceHidden",...et},async fn(e){let{rects:t}=e,{strategy:n="referenceHidden",...r}=g(s,e);switch(n){case"referenceHidden":{let n=A(await w(e,{...r,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:T(n)}}}case"escaped":{let n=A(await w(e,{...r,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:T(n)}}}default:return{}}}}]}),[ex,eb]=eN(eo),eE=(0,ew.W)(j);(0,ev.b)(()=>{el&&eE?.()},[el,eE]);let eR=ea.arrow?.x,eC=ea.arrow?.y,eS=ea.arrow?.centerOffset!==0,[eL,eA]=o.useState();return(0,ev.b)(()=>{N&&eA(window.getComputedStyle(N).zIndex)},[N]),(0,ey.jsx)("div",{ref:en.setFloating,"data-radix-popper-content-wrapper":"",style:{...ei,transform:el?ei.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eL,"--radix-popper-transform-origin":[ea.transformOrigin?.x,ea.transformOrigin?.y].join(" "),...ea.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,ey.jsx)(eO,{scope:h,placedSide:ex,onArrowChange:Y,arrowX:eR,arrowY:eC,shouldHideArrow:eS,children:(0,ey.jsx)(eg.WV.div,{"data-side":ex,"data-align":eb,...M,ref:B,style:{...M.style,animation:el?void 0:"none"}})})})});ek.displayName=eT;var eW="PopperArrow",eH={top:"bottom",right:"left",bottom:"top",left:"right"},ej=o.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=eD(eW,n),o=eH[i.placedSide];return(0,ey.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,ey.jsx)(ex,{...r,ref:t,style:{...r.style,display:"block"}})})});function eM(e){return null!==e}ej.displayName=eW;var eF=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,l=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[s,c]=eN(n),u={start:"0%",center:"50%",end:"100%"}[c],f=(i.arrow?.x??0)+l/2,d=(i.arrow?.y??0)+a/2,p="",h="";return"bottom"===s?(p=o?u:`${f}px`,h=`${-a}px`):"top"===s?(p=o?u:`${f}px`,h=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,h=o?u:`${d}px`):"left"===s&&(p=`${r.floating.width+a}px`,h=o?u:`${d}px`),{data:{x:p,y:h}}}});function eN(e){let[t,n="center"]=e.split("-");return[t,n]}var ez=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,l]=o.useState(!1);(0,ev.b)(()=>l(!0),[]);let a=n||i&&globalThis?.document?.body;return a?ec.createPortal((0,ey.jsx)(eg.WV.div,{...r,ref:t}),a):null});ez.displayName="Portal";var eB=n(79616),eV="dismissableLayer.update",e$=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),e_=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:u,onDismiss:f,...d}=e,p=o.useContext(e$),[h,m]=o.useState(null),g=h?.ownerDocument??globalThis?.document,[,y]=o.useState({}),x=(0,c.e)(t,e=>m(e)),w=Array.from(p.layers),[v]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(v),E=h?w.indexOf(h):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,C=E>=b,P=function(e,t=globalThis?.document){let n=(0,ew.W)(e),r=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){eY("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!C||n||(a?.(e),u?.(e),e.defaultPrevented||f?.())},g),S=function(e,t=globalThis?.document){let n=(0,ew.W)(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&eY("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||f?.())},g);return!function(e,t=globalThis?.document){let n=(0,ew.W)(e);o.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{E!==p.layers.size-1||(i?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))},g),o.useEffect(()=>{if(h)return n&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(r=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(h)),p.layers.add(h),eI(),()=>{n&&1===p.layersWithOutsidePointerEventsDisabled.size&&(g.body.style.pointerEvents=r)}},[h,g,n,p]),o.useEffect(()=>()=>{h&&(p.layers.delete(h),p.layersWithOutsidePointerEventsDisabled.delete(h),eI())},[h,p]),o.useEffect(()=>{let e=()=>y({});return document.addEventListener(eV,e),()=>document.removeEventListener(eV,e)},[]),(0,ey.jsx)(eg.WV.div,{...d,ref:x,style:{pointerEvents:R?C?"auto":"none":void 0,...e.style},onFocusCapture:(0,l.M)(e.onFocusCapture,S.onFocusCapture),onBlurCapture:(0,l.M)(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:(0,l.M)(e.onPointerDownCapture,P.onPointerDownCapture)})});function eI(){let e=new CustomEvent(eV);document.dispatchEvent(e)}function eY(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?(0,eg.jH)(i,o):i.dispatchEvent(o)}e_.displayName="DismissableLayer",o.forwardRef((e,t)=>{let n=o.useContext(e$),r=o.useRef(null),i=(0,c.e)(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,ey.jsx)(eg.WV.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var eX="HoverCard",[eU,eq]=(0,a.b)(eX,[eR]),eK=eR(),[eG,eJ]=eU(eX),eQ=e=>{let{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:l,openDelay:a=700,closeDelay:c=300}=e,u=eK(t),f=o.useRef(0),d=o.useRef(0),p=o.useRef(!1),h=o.useRef(!1),[m,g]=(0,s.T)({prop:r,defaultProp:i??!1,onChange:l,caller:eX}),y=o.useCallback(()=>{clearTimeout(d.current),f.current=window.setTimeout(()=>g(!0),a)},[a,g]),x=o.useCallback(()=>{clearTimeout(f.current),p.current||h.current||(d.current=window.setTimeout(()=>g(!1),c))},[c,g]),w=o.useCallback(()=>g(!1),[g]);return o.useEffect(()=>()=>{clearTimeout(f.current),clearTimeout(d.current)},[]),(0,ey.jsx)(eG,{scope:t,open:m,onOpenChange:g,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:p,isPointerDownOnContentRef:h,children:(0,ey.jsx)(eS,{...u,children:n})})};eQ.displayName=eX;var eZ="HoverCardTrigger",e0=o.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=eJ(eZ,n),o=eK(n);return(0,ey.jsx)(eA,{asChild:!0,...o,children:(0,ey.jsx)(eg.WV.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:(0,l.M)(e.onPointerEnter,e3(i.onOpen)),onPointerLeave:(0,l.M)(e.onPointerLeave,e3(i.onClose)),onFocus:(0,l.M)(e.onFocus,i.onOpen),onBlur:(0,l.M)(e.onBlur,i.onClose),onTouchStart:(0,l.M)(e.onTouchStart,e=>e.preventDefault())})})});e0.displayName=eZ;var e1="HoverCardPortal",[e2,e5]=eU(e1,{forceMount:void 0}),e7=e=>{let{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=eJ(e1,t);return(0,ey.jsx)(e2,{scope:t,forceMount:n,children:(0,ey.jsx)(eB.z,{present:n||o.open,children:(0,ey.jsx)(ez,{asChild:!0,container:i,children:r})})})};e7.displayName=e1;var e4="HoverCardContent",e6=o.forwardRef((e,t)=>{let n=e5(e4,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=eJ(e4,e.__scopeHoverCard);return(0,ey.jsx)(eB.z,{present:r||o.open,children:(0,ey.jsx)(e8,{"data-state":o.open?"open":"closed",...i,onPointerEnter:(0,l.M)(e.onPointerEnter,e3(o.onOpen)),onPointerLeave:(0,l.M)(e.onPointerLeave,e3(o.onClose)),ref:t})})});e6.displayName=e4;var e8=o.forwardRef((e,t)=>{let{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:u,...f}=e,d=eJ(e4,n),p=eK(n),h=o.useRef(null),m=(0,c.e)(t,h),[g,y]=o.useState(!1);return o.useEffect(()=>{if(g){let e=document.body;return i=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect="none",e.style.webkitUserSelect="none",()=>{e.style.userSelect=i,e.style.webkitUserSelect=i}}},[g]),o.useEffect(()=>{if(h.current){let e=()=>{y(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),o.useEffect(()=>{h.current&&(function(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t})(h.current).forEach(e=>e.setAttribute("tabindex","-1"))}),(0,ey.jsx)(e_,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:u,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:(0,l.M)(s,e=>{e.preventDefault()}),onDismiss:d.onDismiss,children:(0,ey.jsx)(ek,{...p,...f,onPointerDown:(0,l.M)(f.onPointerDown,e=>{e.currentTarget.contains(e.target)&&y(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:m,style:{...f.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),e9=o.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=eK(n);return(0,ey.jsx)(ej,{...i,...r,ref:t})});function e3(e){return t=>"touch"===t.pointerType?void 0:e()}e9.displayName="HoverCardArrow";var te=eQ,tt=e0,tn=e7,tr=e6,ti=e9}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[489],{19489:function(e,t,l){"use strict";l.d(t,{H:function(){return e4}});var n=l(52322),i=l(14226),a=l(97729),o=l.n(a),r=l(5632),s=l(2784),c=l(56580),d=l(43388),m=l(77630),u=l(23094),h=l(59294),p=l(58446),x=l(74217),v=l(94160),b=l(68968),y=l(23710),f=l(54597),g=l(98564);let j=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:l}=e,[i,a]=(0,s.useState)(l),o=(0,m.y6)(i),r=g.$[o],{actionQueueStatus:c,setNextAction:d}=(0,y.c)({errorMessage:r.autoSaveFailed}),{refreshState:u}=(0,f.Z)(),h=(0,x.R9)(u),{syncChanges:p}=(0,b.g)(),S=(0,s.useCallback)(e=>{let{customType:t,onSaveCallback:l,updateMeta:n}=e;a(t),d(async()=>{let{errors:e}=await (0,v.KA)({customType:t,updateMeta:n});if(e.length>0)throw e;h(await (0,v.y0)()),p(),null==l||l()})},[d,h,p]),I=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:i,setCustomType:S}),[c,i,S]);return(0,n.jsx)(j.Provider,{value:I,children:"function"==typeof t?t(I):t})}function I(){let e=(0,s.useContext)(j);if(!e)throw Error("CustomTypeProvider not found");return e}var C=l(30195);function T(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:o}=I(),[r,c]=null!==(e=(0,m.j5)(a))&&void 0!==e?e:[],d=c?(0,m.N3)(c):"",[u,h]=(0,s.useState)(null!=d?d:""),[p,v]=(0,s.useState)();(0,x.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let b=(0,s.useCallback)(()=>(0,n.jsx)(i.aX,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,n.jsxs)(i.ae,{open:t,onOpenChange:l,size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:b,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,n.jsx)(i.al,{title:"Edit the UID label"}),(0,n.jsx)(i.aj,{children:(0,n.jsxs)(i.aJ,{onSubmit:function(){p||(o({customType:c?(0,m.eK)(u,a):(0,m.H8)(u,a)}),l(!1))},children:[(0,n.jsx)(i.D,{flexDirection:"column",padding:16,gap:4,children:(0,n.jsx)(i.aM,{type:"text",label:"Label *",placeholder:"UID",value:u,onValueChange:function(e){h(e),v(function(e){let t=D.safeParse(e,{errorMap:w});if(t.error)return t.error.errors[0].message}(e))},error:p,description:"A label for the UID"})}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",disabled:!!p,children:"Save"})]})]})})]})}let D=C.z.string().max(35).min(1),w=e=>{switch(e.code){case C.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case C.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var k=l(94840),_=l(59532),L=l(63397),A=l(75289);let E=e=>{let{name:t,label:l,placeholder:i,error:a,...o}=e;return(0,n.jsxs)(A.xu,{mb:3,children:[(0,n.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,n.jsx)(L.gN,{name:t,type:"text",placeholder:i,as:A.II,autoComplete:"off",...o}),a?(0,n.jsx)(A.xv,{sx:{color:"error",mt:1},children:a}):null]})};var N=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a}=e;return(0,n.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,onSubmit:e=>{l(e),i()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,n.jsx)(E,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},M=e=>{let{isOpen:t,onSubmit:l,close:i}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,n.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,n.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),i()},children:"Yes, remove tab"})]})})},z=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a,initialTabKey:o}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{id:o},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:o,isValid:r}=e;return(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(E,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&o("id",e.target.value.trim())},onChange:e=>{o("id",e.target.value)}}),(0,n.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!r,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),i()},children:"Save"})]})}})},Z=l(28316),O=l(88932),P=l(35289),F=l(87446),K=l(45440),B=l(16086),R=l(358),U=l(5495),V=l(39302),X=l(3285),G=l(40141),Y=l(65077),q=l(91589),H=l(27213);let Q=e=>{let{openCreateSliceModal:t,openCreateSliceFromImageModal:l,openUpdateSliceZoneModal:a,openSlicesTemplatesModal:o,projectHasAvailableSlices:r,isSlicesTemplatesSupported:s}=e,c=(0,H.F)({menuType:"ActionList"});return(0,n.jsxs)(i.s,{"data-testid":"slice-zone-blank-slate",sx:{width:648},children:[(0,n.jsx)(i.x,{lineColor:"purple9",backgroundColor:"purple5",name:"add",size:"large"}),(0,n.jsx)(i.z,{size:"big",children:"Add slices"}),(0,n.jsxs)(i.w,{children:["Slices are website sections that you can reuse on different pages with different content. Each on different pages with different content. Each"," ","slice has its own component in your code."]}),(0,n.jsx)(i.v,{children:(0,n.jsxs)(i.A,{children:[(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromImage.BackgroundIcon,onClick:l,description:c.fromImage.description,children:c.fromImage.title}),(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromScratch.BackgroundIcon,onClick:t,description:c.fromScratch.description,children:c.fromScratch.title}),s&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromTemplate.BackgroundIcon,onClick:o,description:c.fromTemplate.description,children:c.fromTemplate.title}),r&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromExisting.BackgroundIcon,onClick:a,description:c.fromExisting.description,children:c.fromExisting.title})]})})]})};var W=l(98250);function $(e){let{customType:t,tabId:l,slices:n}=e,i={...t};return n.forEach(e=>{i={...i,tabs:i.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),i}var J=l(18566),ee=l(80148);async function et(){try{let{templates:e,errors:t}=await ee.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var el=l(6256),en=l(39204),ei=l(7723),ea=l(33986),eo=l(30527),er=l(55862);let es=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,n.jsx)(er.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,n.jsx)(eo.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:(0,n.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,n.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,n.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,n.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,n.jsx)(ea.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,n.jsx)(ea.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,n.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var ec=l(84879),ed=l(62434),em=l(63908),eu=l(63019),eh=l(65375),ep=l.n(eh);let ex=e=>{var t;let{isOpen:l,close:a,onSubmit:o,isLoading:r,slice:d,libraries:m}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e)})),h={from:null===(t=m[0])||void 0===t?void 0:t.name,sliceName:(0,R.MP)(d.key)},[p,v]=(0,s.useState)(h),[b,y]=(0,s.useState)();function f(e){v(e),y((0,eu.h)(e,m,u))}return(0,x.pQ)(l,()=>{l||(v(h),y(void 0))}),(0,n.jsxs)(i.ae,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Upgrade slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){b&&Object.keys(b).length>0||o({libraryID:p.from,sliceID:p.sliceName})},children:(0,n.jsxs)(i.D,{flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)(i.aM,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,R.MP)(d.key),")"),error:null==b?void 0:b.sliceName,value:p.sliceName,onValueChange:e=>f({...p,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)("label",{className:ep().label,children:(0,n.jsx)(i.bL,{variant:"bold",children:"Slice library *"})}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:p.from,onValueChange:e=>{e&&f({...p,from:e})},children:m.map(e=>(0,n.jsx)(i.bt,{value:e.name,children:e.name},e.name))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:r,disabled:b&&Object.keys(b).length>0,children:"Upgrade"})]})]})})})]})};var ev=l(96009),eb=l.n(ev);let ey=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,slice:d,sliceName:m,libraries:u,localSharedSlices:h}=e,p={libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:eb()(d.key),variationName:m},[v,b]=(0,s.useState)(!0),[y,f]=(0,s.useState)(p),[g,j]=(0,s.useState)({});function S(e){f(e),j(ef(e,u))}return(0,x.pQ)(a,()=>{a||(f(p),j({}))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Convert to slice variation"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){Object.keys(g).length>0||r(y)},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice *"}),"string"==typeof g.libraryID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:g.libraryID}):null,"string"==typeof g.sliceID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:g.sliceID}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(y.libraryID,"::").concat(y.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");S({...y,libraryID:t,sliceID:l})}},children:h.map(e=>(0,n.jsxs)(i.bt,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"Variation name *",placeholder:m,error:g.variationName,value:y.variationName,onValueChange:e=>{let t={...y,variationName:e.slice(0,30)};v&&(t.variationID=eb()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"ID *",placeholder:eb()(d.key),error:g.variationID,value:y.variationID,onValueChange:e=>{b(!1),S({...y,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:Object.keys(g).length>0,children:"Convert"})]})]})})})]})},ef=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let n=t.find(t=>t.path===e.libraryID);l.libraryID||n||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let i=null==n?void 0:n.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||i||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==i?void 0:i.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},eg=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,identicalSlices:d}=e,m=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[u,h]=(0,s.useState)(m),[p,v]=(0,s.useState)();return(0,x.pQ)(a,()=>{a||(h(m),v(void 0))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Merge with an existing slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){if(p)return;let[e,t,l]=u.split("::");r({libraryID:e,sliceID:t,variationID:l})},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice*"}),"string"==typeof p?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:p}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:u,onValueChange:function(e){h(e),e||v("Cannot be empty.")},children:d.map(e=>(0,n.jsx)(i.bt,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:!!p,children:"Merge"})]})]})})})]})},ej=e=>{var t;let{slice:l,path:a}=e,{refreshState:o}=(0,f.Z)(),[r,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(),{setCustomType:h}=I(),{libraries:p}=(0,c.v9)(e=>({libraries:(0,ei.Sd)(e)})),x="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,b=p.filter(e=>e.isLocal),y=b.map(e=>e.components).flat(),g=eS(l,x,y),j=async e=>{var t,n,i;if(!m)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:m});let{errors:r}=await ee.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(n=e.variationName)&&void 0!==n?n:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}});if(r.length)throw console.error("Could not convert slice `".concat(x,"`"),r),O.Am.error("Could not convert slice `".concat(x,"`")),r;let{model:s,errors:c}=await ee.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),O.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(o(await (0,v.y0)()),d(!1),u(void 0),m){case"as_new_slice":O.Am.success("".concat(x," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":O.Am.success("".concat(x," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:O.Am.success("".concat(x," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h({customType:s})},S={path:a,slice:l,sliceName:x,libraries:b,localSharedSlices:y,identicalSlices:g,close:()=>u(void 0),onSubmit:j,isLoading:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,n.jsxs)(i.as,{align:"start",children:[(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>u("as_new_slice"),children:"Upgrade slice"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>u("as_new_variation"),disabled:!y.length,children:"Convert to slice variation"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>u("merge_with_identical"),disabled:!g.length,children:"Merge with another slice"})]})]}),(0,n.jsx)(ex,{...S,isOpen:"as_new_slice"===m}),(0,n.jsx)(ey,{...S,isOpen:"as_new_variation"===m}),(0,n.jsx)(eg,{...S,isOpen:"merge_with_identical"===m})]})},eS=(e,t,l)=>(0,s.useMemo)(()=>{let n=[],i=(0,em.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,em.ux)(t,e.model.name);i.primary===l.primary&&i.items===l.items&&n.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return n},[e,t,l]),eI=e=>{let{slice:t,path:l}=e,[a]=(0,ec.E)("legacySliceUpgrader"),o=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,n.jsxs)(ed.Zb,{children:[(0,n.jsx)(ed.ZB,{component:"div",children:(0,n.jsx)(i.D,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(i.bL,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,n.jsxs)(ed.T$,{children:[(0,n.jsx)(i.c3,{content:o,side:"bottom",children:(0,n.jsx)(i.m,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,n.jsx)(ej,{slice:t,path:l}):null]}),(0,n.jsx)(ed.eW,{subtitle:"1 variation",title:(0,em.Dj)(t.value)})]})};var eC=l(51507),eT=l(21151);let eD=e=>{let{slices:t,format:l,path:i,onRemoveSharedSlice:a}=e,o=t.some(e=>"SharedSlice"!==e.type),r=g.$[l],[c]=(0,ec.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{o&&(c.enabled?O.Am.info("This ".concat(r.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):O.Am.warning("This ".concat(r.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[o]),(0,n.jsx)(eT.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,n.jsx)(eI,{slice:t,path:i})}{let t=e.payload;return(0,n.jsx)(eC.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,location:n,onSuccess:i}=e,{data:a,errors:o}=await ee.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(o.length>0||void 0===a)throw o;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],location:n,mode:"template",sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),O.Am.error(e)}}var ek=l(26109),e_=e=>{let{availableSlices:t,values:l}=e;return(0,n.jsx)(L.F2,{name:"sliceKeys",render:e=>(0,n.jsx)(eT.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{let i=l.sliceKeys.includes(t.model.id);return(0,n.jsx)(eC.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:n=>{n?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:i,slice:t,variant:"outlined"})}})})};let eL=e=>{let{formId:t,close:l,onSuccess:i,availableSlicesTemplates:a,localLibraries:o,location:r}=e,{createSliceSuccess:s}=(0,f.Z)();return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:o.map(e=>e.name),location:r,onSuccess:async e=>{s((await (0,v.y0)()).libraries),i(await Promise.all(e.map(async e=>(await ee.managerClient.slices.readSlice({libraryID:o[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:ek.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})}))})}})};var eA=e=>{let{formId:t,close:l,onSubmit:i,availableSlices:a}=e;return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;i(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a})}})};let eE=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:n,notFound:i}=e.value.reduce((e,t)=>{let{key:n,value:i}=t;if("SharedSlice"===i.type){let t=l.find(e=>e.model.id===n);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:n}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:n,value:i}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:n,notFound:i}};var eN=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:o,onRemoveSharedSlice:r,sliceZone:d,tabId:m}=e,u=(0,J.QT)(et,[]),[h,p]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),[y,g]=(0,s.useState)(!1),[j,S]=(0,s.useState)(!1),{remoteSlices:C,libraries:T}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e),libraries:(0,ei.Sd)(e),slices:(0,ei.xC)(e)})),{setCustomType:D}=I(),{completeStep:w}=(0,W.k)(),{openLoginModal:_}=(0,f.Z)(),L=(0,H.F)({menuType:"Dropdown"}),A=T.filter(e=>e.isLocal),{availableSlices:E,slicesInSliceZone:N,notFound:M}=(0,s.useMemo)(()=>d?eE(d,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,T]),[z,Z]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==M?void 0:M.length)&&M.forEach(e=>{let{key:t}=e;r(t)})},[M]);let F=N.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),K=E.filter(e=>!F.some(t=>t.model.id===e.model.id)),B=()=>{b(!0)},R=()=>{g(!0)},U=async()=>{await ee.managerClient.user.checkIsLoggedIn()?S(!0):_()},V=()=>{p(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},X=()=>{b(!1)},G=()=>{g(!1)},ea=()=>{S(!1)},eo=()=>{p(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.Bu,{actions:d?(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,n.jsxs)(i.as,{align:"end",children:[(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromImage.BackgroundIcon,onSelect:()=>void U(),description:L.fromImage.description,children:L.fromImage.title}),(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromScratch.BackgroundIcon,onSelect:R,description:L.fromScratch.description,children:L.fromScratch.title}),u.length>0?(0,n.jsx)(i.at,{onSelect:V,renderStartIcon:()=>L.fromTemplate.BackgroundIcon,description:L.fromTemplate.description,children:L.fromTemplate.title}):void 0,K.length>0?(0,n.jsx)(i.at,{onSelect:B,renderStartIcon:()=>L.fromExisting.BackgroundIcon,description:L.fromExisting.description,children:L.fromExisting.title}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==m?(0,n.jsx)(i.bC,{checked:!!d,onCheckedChange:e=>{e?a():Z(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?N.length>0?(0,n.jsx)(Y.xR,{children:(0,n.jsx)(eD,{slices:N,format:l.format,path:{customTypeID:l.id,tabID:m,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:r})}):(0,n.jsx)(i.D,{flexDirection:"column",flexGrow:1,justifyContent:"center",alignItems:"center",padding:{block:32},children:(0,n.jsx)(Q,{openUpdateSliceZoneModal:B,openCreateSliceModal:R,openCreateSliceFromImageModal:()=>void U(),openSlicesTemplatesModal:V,projectHasAvailableSlices:K.length>0,isSlicesTemplatesSupported:u.length>0})}):void 0,x&&(0,n.jsx)(eA,{formId:"tab-slicezone-form-".concat(m),availableSlices:K,onSubmit:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success("Slice(s) added to slice zone")}}),w("createSlice"),X()},close:X}),h&&(0,n.jsx)(eL,{formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:u,localLibraries:A,location:"".concat(l.format,"_type"),onSuccess:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),w("createSlice"),eo()},close:eo}),z&&(0,n.jsx)(es,{closeDeleteSliceZoneModal:()=>{Z(!1)},deleteSliceZone:()=>{o(),Z(!1)}}),(null==A?void 0:A.length)!==0&&y&&(0,n.jsx)(el.c,{onSuccess:e=>{let t=$({customType:l,tabId:m,slices:[e]});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),G()},localLibraries:A,location:"".concat(l.format,"_type"),remoteSlices:C,onClose:G}),(0,n.jsx)(q.S,{open:j,location:"".concat(l.format,"_type"),onSuccess:e=>{let{slices:t,library:i}=e,a=$({customType:l,tabId:m,slices:t.map(e=>e.model)});D({customType:k.Dc.fromSM(a),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice(s) added to slice zone and created at: ",path:i}))}}),ea()},onClose:ea})]})};let eM=[K.C.UID,K.C.Image,K.C.Text,K.C.StructuredText,K.C.Link,K.C.Select,K.C.Boolean,K.C.Number,K.C.Color,K.C.Date,K.C.Table,K.C.Embed,K.C.Timestamp,K.C.GeoPoint,K.C.ContentRelationship,K.C.LinkToMedia,K.C.Group,K.C.NestedGroup];var ez=e=>{var t,l,a,o;let{tabId:r}=e,{customType:c,setCustomType:d}=I(),u=k.Dc.toSM(c),h=null===(t=u.tabs.find(e=>e.key===r))||void 0===t?void 0:t.sliceZone,p=null!==(a=null===(l=u.tabs.find(e=>e.key===r))||void 0===l?void 0:l.value)&&void 0!==a?a:[],x="page"===u.format&&u.repeatable?p.filter(e=>"uid"!==e.key):p,v=u.tabs.reduce((e,t)=>[...e,...t.value],[]),b=e=>{var t;let{apiId:l,value:n}=e,i=null===(t=n.config)||void 0===t?void 0:t.label;if((0,B.Ss)(K.C,n.type)||null==i)return;if("Range"===n.type||"IntegrationFields"===n.type||"Separator"===n.type)throw Error("Unsupported Field Type: ".concat(n.type));let a=K.C[n.type];try{a.schema.validateSync(n,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(n.type,'".'))}let o=k.L$.fromSM(n);d({customType:(0,m.xS)({customType:c,newField:o,newFieldId:l,sectionId:r}),onSaveCallback:()=>{O.Am.success("".concat("Group"===n.type?"Group":"Field"," added"))}}),(0,U.V)({id:l,field:o})},y=e=>{let{apiId:t,newKey:l,value:n,inGroupFieldAction:i,updateMeta:a}=e;if((0,B.Ss)(K.C,n.type))return;let o=k.L$.fromSM(n);d({customType:(0,m.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:o,sectionId:r}),onSaveCallback:()=>{"add"===i&&O.Am.success("Field added")},updateMeta:a}),i||(0,V.Z)({previousId:t,id:l,field:o})};return(0,n.jsx)(F.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.D,{padding:32,children:(0,n.jsx)(i.bg,{})}),children:(0,n.jsxs)(P.aV,{border:!1,style:{flexGrow:1},children:[(0,n.jsx)(G.Z,{zoneType:"customType",zoneTypeFormat:null!==(o=c.format)&&void 0!==o?o:"custom",tabId:r,title:"Static zone",dataTip:"",fields:x,poolOfFieldsToCheck:v,showHints:!0,EditModal:X.Z,widgetsArray:eM,onDeleteItem:e=>{d({customType:(0,m.AK)({customType:c,fieldId:e,sectionId:r})})},onSave:e=>""===e.apiId?b({...e,apiId:e.newKey}):y(e),onDragEnd:e=>{if((0,B.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let n=(0,m.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:r});(0,Z.flushSync)(()=>d({customType:n}))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,R.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,R.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,n.jsx)(eN,{customType:u,tabId:r,sliceZone:h,onRemoveSharedSlice:e=>{d({customType:(0,m.EN)({customType:c,sectionId:r,sliceId:e})})},onCreateSliceZone:()=>{d({customType:(0,m.Tr)(c,r)})},onDeleteSliceZone:()=>{d({customType:(0,m.E3)(c,r)})}})]})})})};let eZ=()=>{var e,t,l;let{customType:a,setCustomType:o}=I(),r=k.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=r.tabs[0])||void 0===e?void 0:e.key),[u,h]=(0,s.useState)(),p=(null===(l=r.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.c9,{sx:p?{flexGrow:1}:void 0,children:["page"===a.format?(0,n.jsx)(i.ca,{title:a.repeatable?(0,n.jsx)(T,{}):void 0}):void 0,(0,n.jsxs)(i.cb,{onValueChange:d,value:c,children:[(0,n.jsx)(i.cd,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:r.tabs.map(e=>(0,n.jsx)(i.ce,{menu:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.at,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"edit"}),children:"Rename"}),(0,n.jsx)(i.at,{color:"tomato",disabled:function(e){if(r.tabs.length<=1)return!0;let t=r.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),r.tabs.map(e=>(0,n.jsx)(i.cc,{value:e.key,children:(0,n.jsx)(ez,{tabId:e.key})},e.key))]})]}),(null==u?void 0:u.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(N,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.vB)(a,t)}),d(t)},tabIds:r.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(z,{close:()=>{h(void 0)},initialTabKey:u.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.HO)(a,u.tabKey,t)}),c===u.tabKey&&d(t)},tabIds:r.tabs.filter(e=>e.key!==u.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,n.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(o({customType:(0,m.F$)(a,u.tabKey)}),c===u.tabKey){var e;let t=null===(e=r.tabs.find(e=>e.key!==u.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eO=l(16442),eP=l(78254),eF=l(60867),eK=l(11166),eB=l(34919),eR=l.n(eB);let eU=e=>{let{tabs:t,...l}=e;return(0,n.jsxs)(eK.fC,{...l,className:eR().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,n.jsx)(eK.aV,{className:eR().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,n.jsx)(eK.xz,{className:eR().trigger,value:l,children:(0,n.jsx)(i.bL,{className:eR().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,n.jsx)(eK.VY,{className:eR().content,value:l,children:(0,n.jsx)(i.bn,{className:eR().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eV=l(25661),eX=l(88241),eG=l(32554),eY=l(44621),eq=l.n(eY);let eH=e=>{var t,l;let{inline:a,...o}=e,r=(0,eG.p)();if(!0===a)return(0,n.jsx)("code",{...o,className:eq().inlineCode});let s=(()=>{var e,t,l,n,i;if((null===(t=o.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(n=o.node)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(i=o.className)||void 0===i?void 0:i.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=o.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,n.jsx)(i.W,{...o,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:r})},language:c,code:String(o.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},eQ=e=>{let{markdown:t}=e;return(0,n.jsx)(eV.D,{children:t,linkTarget:"_blank",remarkPlugins:[eX.Z],components:{code:e=>(0,n.jsx)(eH,{...e}),h1:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"pre",variant:"normal"})}})};async function eW(e){let t=JSON.parse(e),{errors:l,documentation:n}=await ee.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return n}var e$=l(65480),eJ=l.n(e$);let e0=e=>{var t;let{model:l}=e,a=(0,eG.p)(),o=(t={kind:"PageSnippet",data:{model:l}},(0,J.QT)(eW,[JSON.stringify(t)])),{completeStep:r}=(0,W.k)();return 0===o.length?null:(0,n.jsxs)(i.ae,{size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",onClick:()=>{r("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,n.jsx)(i.al,{icon:"code",title:"Page snippet"}),(0,n.jsx)("section",{className:eJ().content,children:o.length>1?(0,n.jsx)(eU,{style:{flex:1},tabs:o.map((e,t)=>{let{label:l,content:i}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,n.jsx)(eQ,{markdown:i})}})}):(0,n.jsx)(i.bn,{style:{flex:1,padding:16},children:(0,n.jsx)(eQ,{markdown:o[0].content})})})]})},e1=e=>{let{model:t}=e;return(0,n.jsx)("div",{children:(0,n.jsx)(F.h,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.E,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,n.jsx)(e0,{model:t})})})})},e4=()=>{let e=(0,r.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eP.Jk)(t,(0,h.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eO.TG)(t)||e.replace("/")},[t,e]),t&&(0,eO.TG)(t))?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,n.jsx)(e6,{customType:t.local})]}):(0,n.jsx)(p.LN,{})},e6=e=>{let{customType:t}=e;return null===t?(0,n.jsx)(p.LN,{}):(0,n.jsx)(p.LN,{children:(0,n.jsx)(S,{initialCustomType:k.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:o,setCustomType:r}=e,s=(0,m.y6)(o),c=h.cd[t.format],x=g.$[t.format];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(p.wd,{children:[(0,n.jsx)(p.Xq,{url:c.tablePagePathname}),(0,n.jsxs)(p.Cx,{children:[(0,n.jsx)(d.g,{children:x.name({start:!0,plural:!0})}),(0,n.jsx)(d.g,{active:!0,children:null!==(l=o.label)&&void 0!==l?l:o.id})]}),(0,n.jsxs)(p.K2,{children:[(0,n.jsx)(u.X,{status:a}),"page"===o.format?(0,n.jsx)(e1,{model:o}):void 0,(0,n.jsx)(eF._,{isChangesLocal:!0,format:s,customType:o,setLocalCustomType:r})]})]}),(0,n.jsx)(p.RN,{children:(0,n.jsx)(i.D,{flexDirection:"column",minWidth:0,children:(0,n.jsx)(eZ,{})})})]})}})})}},84879:function(e,t,l){"use strict";l.d(t,{E:function(){return o}});var n=l(18566),i=l(80148);async function a(){return i.managerClient.project.getSliceMachineConfig()}function o(e){var t,l;let[o,r]=[(0,n.QT)(a,[]),async e=>{await i.managerClient.project.writeSliceMachineConfig({config:e}),(0,n.VA)(a,[],e)}],s=async t=>{let l={...o,labs:{...o.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await r(l)};return[{enabled:null!==(l=null==o?void 0:null===(t=o.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},s]}},34919:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},65480:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},44621:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},65375:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[489],{19489:function(e,t,l){"use strict";l.d(t,{H:function(){return e4}});var n=l(52322),i=l(11699),a=l(97729),o=l.n(a),r=l(5632),s=l(2784),c=l(56580),d=l(43388),m=l(77630),u=l(23094),h=l(59294),p=l(62813),x=l(74217),v=l(94160),b=l(68968),y=l(23710),f=l(54597),g=l(98564);let j=(0,s.createContext)(void 0);function S(e){let{children:t,initialCustomType:l}=e,[i,a]=(0,s.useState)(l),o=(0,m.y6)(i),r=g.$[o],{actionQueueStatus:c,setNextAction:d}=(0,y.c)({errorMessage:r.autoSaveFailed}),{refreshState:u}=(0,f.Z)(),h=(0,x.R9)(u),{syncChanges:p}=(0,b.g)(),S=(0,s.useCallback)(e=>{let{customType:t,onSaveCallback:l,updateMeta:n}=e;a(t),d(async()=>{let{errors:e}=await (0,v.KA)({customType:t,updateMeta:n});if(e.length>0)throw e;h(await (0,v.y0)()),p(),null==l||l()})},[d,h,p]),I=(0,s.useMemo)(()=>({actionQueueStatus:c,customType:i,setCustomType:S}),[c,i,S]);return(0,n.jsx)(j.Provider,{value:I,children:"function"==typeof t?t(I):t})}function I(){let e=(0,s.useContext)(j);if(!e)throw Error("CustomTypeProvider not found");return e}var C=l(30195);function T(){var e;let[t,l]=(0,s.useState)(!1),{customType:a,setCustomType:o}=I(),[r,c]=null!==(e=(0,m.j5)(a))&&void 0!==e?e:[],d=c?(0,m.N3)(c):"",[u,h]=(0,s.useState)(null!=d?d:""),[p,v]=(0,s.useState)();(0,x.pQ)(t,()=>{t||(h(null!=d?d:""),v(void 0))});let b=(0,s.useCallback)(()=>(0,n.jsx)(i.aX,{name:c?"language":"add",size:"small",color:"grey11"}),[c]);return(0,n.jsxs)(i.ae,{open:t,onOpenChange:l,size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",textColor:"placeholder",textWeight:"normal",renderStartIcon:b,sx:{marginInline:"auto"},children:c?d:"Add an UID"}),children:[(0,n.jsx)(i.al,{title:"Edit the UID label"}),(0,n.jsx)(i.aj,{children:(0,n.jsxs)(i.aJ,{onSubmit:function(){p||(o({customType:c?(0,m.eK)(u,a):(0,m.H8)(u,a)}),l(!1))},children:[(0,n.jsx)(i.D,{flexDirection:"column",padding:16,gap:4,children:(0,n.jsx)(i.aM,{type:"text",label:"Label *",placeholder:"UID",value:u,onValueChange:function(e){h(e),v(function(e){let t=D.safeParse(e,{errorMap:w});if(t.error)return t.error.errors[0].message}(e))},error:p,description:"A label for the UID"})}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",disabled:!!p,children:"Save"})]})]})})]})}let D=C.z.string().max(35).min(1),w=e=>{switch(e.code){case C.z.ZodIssueCode.too_big:return{message:"The label can't be longer than ".concat(e.maximum," characters")};case C.z.ZodIssueCode.too_small:return{message:"This field is required"};default:return{message:"Invalid value"}}};var k=l(94840),_=l(59532),L=l(63397),A=l(75289);let E=e=>{let{name:t,label:l,placeholder:i,error:a,...o}=e;return(0,n.jsxs)(A.xu,{mb:3,children:[(0,n.jsx)(A.__,{htmlFor:t,mb:2,children:l}),(0,n.jsx)(L.gN,{name:t,type:"text",placeholder:i,as:A.II,autoComplete:"off",...o}),a?(0,n.jsx)(A.xv,{sx:{color:"error",mt:1},children:a}):null]})};var N=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a}=e;return(0,n.jsx)(_.Z,{isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,onSubmit:e=>{l(e),i()},initialValues:{id:""},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:e=>{let{errors:t}=e;return(0,n.jsx)(E,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id})}})},M=e=>{let{isOpen:t,onSubmit:l,close:i}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{},content:{title:"Remove Tab"},children:()=>(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(A.X6,{as:"h4",children:"Remove this tab?"}),(0,n.jsx)(A.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,n.jsx)(A.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:()=>{l({}),i()},children:"Yes, remove tab"})]})})},z=e=>{let{isOpen:t,onSubmit:l,close:i,tabIds:a,initialTabKey:o}=e;return(0,n.jsx)(_.Z,{omitFooter:!0,isOpen:t,widthInPx:"530px",formId:"create-tab",close:i,cardProps:{bodySx:{p:0}},onSubmit:e=>{l(e),i()},initialValues:{id:o},validate:e=>{let{id:t}=e;return t?a.includes(t.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:e=>{let{errors:t,values:a,setFieldValue:o,isValid:r}=e;return(0,n.jsxs)(A.xu,{sx:{px:4,py:4},children:[(0,n.jsx)(E,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:t.id,onBlur:e=>{a.id!==e.target.value&&o("id",e.target.value.trim())},onChange:e=>{o("id",e.target.value)}}),(0,n.jsx)(A.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!r,onClick:()=>{a.id&&a.id.length&&l({id:a.id.trim()}),i()},children:"Save"})]})}})},Z=l(28316),O=l(88932),P=l(35289),F=l(17378),K=l(45440),B=l(16086),R=l(358),U=l(5495),V=l(39302),X=l(3285),G=l(40141),Y=l(65077),q=l(91589),H=l(27213);let Q=e=>{let{openCreateSliceModal:t,openCreateSliceFromImageModal:l,openUpdateSliceZoneModal:a,openSlicesTemplatesModal:o,projectHasAvailableSlices:r,isSlicesTemplatesSupported:s}=e,c=(0,H.F)({menuType:"ActionList"});return(0,n.jsxs)(i.s,{"data-testid":"slice-zone-blank-slate",sx:{width:648},children:[(0,n.jsx)(i.x,{lineColor:"purple9",backgroundColor:"purple5",name:"add",size:"large"}),(0,n.jsx)(i.z,{size:"big",children:"Add slices"}),(0,n.jsxs)(i.w,{children:["Slices are website sections that you can reuse on different pages with different content. Each on different pages with different content. Each"," ","slice has its own component in your code."]}),(0,n.jsx)(i.v,{children:(0,n.jsxs)(i.A,{children:[(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromImage.BackgroundIcon,onClick:l,description:c.fromImage.description,children:c.fromImage.title}),(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromScratch.BackgroundIcon,onClick:t,description:c.fromScratch.description,children:c.fromScratch.title}),s&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromTemplate.BackgroundIcon,onClick:o,description:c.fromTemplate.description,children:c.fromTemplate.title}),r&&(0,n.jsx)(i.b,{renderStartIcon:()=>c.fromExisting.BackgroundIcon,onClick:a,description:c.fromExisting.description,children:c.fromExisting.title})]})})]})};var W=l(98250);function $(e){let{customType:t,tabId:l,slices:n}=e,i={...t};return n.forEach(e=>{i={...i,tabs:i.tabs.map(t=>t.key===l&&t.sliceZone?{...t,sliceZone:{key:t.sliceZone.key,value:[{key:e.id,value:e},...t.sliceZone.value]}}:t)}}),v.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:t.id}),i}var J=l(18566),ee=l(80148);async function et(){try{let{templates:e,errors:t}=await ee.managerClient.sliceTemplateLibrary.readLibrary({});if(t.length>0)throw t;return e.map(e=>({model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(e=>{let[t,l]=e;return[t,URL.createObjectURL(l)]}))}))}catch(e){return[]}}var el=l(6256),en=l(39204),ei=l(7723),ea=l(33986),eo=l(30527),er=l(55862);let es=e=>{let{deleteSliceZone:t,closeDeleteSliceZoneModal:l}=e;return(0,n.jsx)(er.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:l,children:(0,n.jsx)(eo.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:(0,n.jsxs)(A.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,n.jsx)(A.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,n.jsx)(A.x8,{type:"button",onClick:l})]}),Footer:()=>(0,n.jsxs)(A.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,n.jsx)(ea.z,{label:"Cancel",variant:"secondary",onClick:l,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,n.jsx)(ea.z,{label:"Delete",variant:"danger",onClick:t,sx:{minHeight:39,minWidth:78}})]}),children:(0,n.jsx)(A.nv,{children:"You're about to delete Slice Zone."})})})};var ec=l(84879),ed=l(62434),em=l(63908),eu=l(63019),eh=l(65375),ep=l.n(eh);let ex=e=>{var t;let{isOpen:l,close:a,onSubmit:o,isLoading:r,slice:d,libraries:m}=e,{remoteSlices:u}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e)})),h={from:null===(t=m[0])||void 0===t?void 0:t.name,sliceName:(0,R.MP)(d.key)},[p,v]=(0,s.useState)(h),[b,y]=(0,s.useState)();function f(e){v(e),y((0,eu.h)(e,m,u))}return(0,x.pQ)(l,()=>{l||(v(h),y(void 0))}),(0,n.jsxs)(i.ae,{open:l,onOpenChange:e=>!e&&a(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Upgrade slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){b&&Object.keys(b).length>0||o({libraryID:p.from,sliceID:p.sliceName})},children:(0,n.jsxs)(i.D,{flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)(i.aM,{label:"Slice name *",placeholder:"Pascalised Slice API ID (e.g. ".concat((0,R.MP)(d.key),")"),error:null==b?void 0:b.sliceName,value:p.sliceName,onValueChange:e=>f({...p,sliceName:e.slice(0,30)}),"data-testid":"slice-name-input"}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,n.jsxs)(i.D,{flexDirection:"column",gap:4,children:[(0,n.jsx)("label",{className:ep().label,children:(0,n.jsx)(i.bL,{variant:"bold",children:"Slice library *"})}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:p.from,onValueChange:e=>{e&&f({...p,from:e})},children:m.map(e=>(0,n.jsx)(i.bt,{value:e.name,children:e.name},e.name))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:r,disabled:b&&Object.keys(b).length>0,children:"Upgrade"})]})]})})})]})};var ev=l(96009),eb=l.n(ev);let ey=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,slice:d,sliceName:m,libraries:u,localSharedSlices:h}=e,p={libraryID:null===(t=h[0])||void 0===t?void 0:t.from,sliceID:null===(l=h[0])||void 0===l?void 0:l.model.id,variationID:eb()(d.key),variationName:m},[v,b]=(0,s.useState)(!0),[y,f]=(0,s.useState)(p),[g,j]=(0,s.useState)({});function S(e){f(e),j(ef(e,u))}return(0,x.pQ)(a,()=>{a||(f(p),j({}))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Convert to slice variation"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){Object.keys(g).length>0||r(y)},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice *"}),"string"==typeof g.libraryID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:g.libraryID}):null,"string"==typeof g.sliceID?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:g.sliceID}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(y.libraryID,"::").concat(y.sliceID),onValueChange:e=>{if(e){let[t,l]=e.split("::");S({...y,libraryID:t,sliceID:l})}},children:h.map(e=>(0,n.jsxs)(i.bt,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id)))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"Variation name *",placeholder:m,error:g.variationName,value:y.variationName,onValueChange:e=>{let t={...y,variationName:e.slice(0,30)};v&&(t.variationID=eb()(t.variationName)),S(t)},"data-testid":"variation-name-input"})}),(0,n.jsx)(i.D,{display:"flex",flexDirection:"column",gap:4,children:(0,n.jsx)(i.aM,{label:"ID *",placeholder:eb()(d.key),error:g.variationID,value:y.variationID,onValueChange:e=>{b(!1),S({...y,variationID:e.slice(0,30)})},"data-testid":"variation-id-input"})})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:Object.keys(g).length>0,children:"Convert"})]})]})})})]})},ef=(e,t)=>{let l={};e.libraryID||(l.libraryID="Cannot be empty.");let n=t.find(t=>t.path===e.libraryID);l.libraryID||n||(l.libraryID="Does not exist."),e.sliceID||(l.sliceID="Cannot be empty.");let i=null==n?void 0:n.components.find(t=>t.model.id===e.sliceID);if(l.sliceID||i||(l.sliceID="Does not exist."),e.variationName||(l.variationName="Cannot be empty."),e.variationID){var a;(null!==(a=null==i?void 0:i.model.variations.map(e=>e.id))&&void 0!==a?a:[]).includes(e.variationID)&&(l.variationID="Slice variation ID is already taken.")}else l.variationID="Cannot be empty.";return l},eg=e=>{var t,l;let{isOpen:a,close:o,onSubmit:r,isLoading:c,identicalSlices:d}=e,m=null!==(l=null===(t=d[0])||void 0===t?void 0:t.path)&&void 0!==l?l:"",[u,h]=(0,s.useState)(m),[p,v]=(0,s.useState)();return(0,x.pQ)(a,()=>{a||(h(m),v(void 0))}),(0,n.jsxs)(i.ae,{open:a,onOpenChange:e=>!e&&o(),size:{width:448,height:"auto"},children:[(0,n.jsx)(i.al,{title:"Merge with an existing slice"}),(0,n.jsx)(i.aj,{children:(0,n.jsx)(i.aJ,{onSubmit:function(){if(p)return;let[e,t,l]=u.split("::");r({libraryID:e,sliceID:t,variationID:l})},children:(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",children:[(0,n.jsxs)(i.bn,{className:ep().scrollArea,children:[(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,n.jsxs)(i.D,{display:"flex",flexDirection:"column",gap:4,children:[(0,n.jsxs)("label",{className:ep().label,children:[(0,n.jsx)(i.bL,{variant:"bold",children:"Target slice*"}),"string"==typeof p?(0,n.jsx)(i.bL,{variant:"small",color:"tomato10",children:p}):null]}),(0,n.jsx)(i.bq,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:u,onValueChange:function(e){h(e),e||v("Cannot be empty.")},children:d.map(e=>(0,n.jsx)(i.bt,{value:e.path,children:e.path.split("::").join(" > ")},e.path))}),(0,n.jsx)(i.bL,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,n.jsxs)(i.ah,{children:[(0,n.jsx)(i.ai,{size:"medium"}),(0,n.jsx)(i.af,{type:"submit",size:"medium",loading:c,disabled:!!p,children:"Merge"})]})]})})})]})},ej=e=>{var t;let{slice:l,path:a}=e,{refreshState:o}=(0,f.Z)(),[r,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(),{setCustomType:h}=I(),{libraries:p}=(0,c.v9)(e=>({libraries:(0,ei.Sd)(e)})),x="Slice"===l.value.type&&null!==(t=l.value.fieldset)&&void 0!==t?t:l.key,b=p.filter(e=>e.isLocal),y=b.map(e=>e.components).flat(),g=eS(l,x,y),j=async e=>{var t,n,i;if(!m)return;d(!0),v.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(t=e.variationID)&&void 0!==t?t:"default",library:e.libraryID,conversionType:m});let{errors:r}=await ee.managerClient.slices.convertLegacySliceToSharedSlice({model:l.value,src:{...a,sliceID:l.key},dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(n=e.variationName)&&void 0!==n?n:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}});if(r.length)throw console.error("Could not convert slice `".concat(x,"`"),r),O.Am.error("Could not convert slice `".concat(x,"`")),r;let{model:s,errors:c}=await ee.managerClient.customTypes.readCustomType({id:a.customTypeID});if(c.length||!s){console.error("Could not refresh custom type view `".concat(a.customTypeID,"`"),c),O.Am.error("Could not refresh custom type view `".concat(a.customTypeID,"`"));return}switch(o(await (0,v.y0)()),d(!1),u(void 0),m){case"as_new_slice":O.Am.success("".concat(x," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":O.Am.success("".concat(x," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:O.Am.success("".concat(x," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}h({customType:s})},S={path:a,slice:l,sliceName:x,libraries:b,localSharedSlices:y,identicalSlices:g,close:()=>u(void 0),onSubmit:j,isLoading:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,n.jsxs)(i.as,{align:"start",children:[(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:()=>u("as_new_slice"),children:"Upgrade slice"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:()=>u("as_new_variation"),disabled:!y.length,children:"Convert to slice variation"}),(0,n.jsx)(i.at,{startIcon:(0,n.jsx)(i.aX,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:()=>u("merge_with_identical"),disabled:!g.length,children:"Merge with another slice"})]})]}),(0,n.jsx)(ex,{...S,isOpen:"as_new_slice"===m}),(0,n.jsx)(ey,{...S,isOpen:"as_new_variation"===m}),(0,n.jsx)(eg,{...S,isOpen:"merge_with_identical"===m})]})},eS=(e,t,l)=>(0,s.useMemo)(()=>{let n=[],i=(0,em.ux)(e.value,t);for(let e of l)for(let t of e.model.variations){let l=(0,em.ux)(t,e.model.name);i.primary===l.primary&&i.items===l.items&&n.push({libraryID:e.from,sliceID:e.model.id,variationID:t.id,path:"".concat(e.from,"::").concat(e.model.id,"::").concat(t.id)})}return n},[e,t,l]),eI=e=>{let{slice:t,path:l}=e,[a]=(0,ec.E)("legacySliceUpgrader"),o=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,n.jsxs)(ed.Zb,{children:[(0,n.jsx)(ed.ZB,{component:"div",children:(0,n.jsx)(i.D,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(i.bL,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,n.jsxs)(ed.T$,{children:[(0,n.jsx)(i.c3,{content:o,side:"bottom",children:(0,n.jsx)(i.m,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,n.jsx)(ej,{slice:t,path:l}):null]}),(0,n.jsx)(ed.eW,{subtitle:"1 variation",title:(0,em.Dj)(t.value)})]})};var eC=l(51507),eT=l(21151);let eD=e=>{let{slices:t,format:l,path:i,onRemoveSharedSlice:a}=e,o=t.some(e=>"SharedSlice"!==e.type),r=g.$[l],[c]=(0,ec.E)("legacySliceUpgrader");return(0,s.useEffect)(()=>{o&&(c.enabled?O.Am.info("This ".concat(r.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):O.Am.warning("This ".concat(r.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[o]),(0,n.jsx)(eT.Z,{elems:t,defineElementKey:e=>"SharedSlice"!==e.type?e.payload.key:e.payload.model.name,renderElem:e=>{if("SharedSlice"!==e.type){let t=e.payload;return(0,n.jsx)(eI,{slice:t,path:i})}{let t=e.payload;return(0,n.jsx)(eC.b,{action:{type:"remove",onRemove:()=>{a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})}},sx:{padding:"16px"}})};async function ew(e){try{let{templateIDs:t,localLibrariesNames:l,location:n,onSuccess:i}=e,{data:a,errors:o}=await ee.managerClient.sliceTemplateLibrary.createSlices({templateIDs:t});if(o.length>0||void 0===a)throw o;a.sliceIDs.forEach((e,i)=>{v.Xe.track({event:"slice:created",id:e,name:e,library:l[0],location:n,mode:"template",sliceTemplate:t[i]})}),await i(a.sliceIDs)}catch(t){let e="Internal Error: Slice(s) not created";console.error(e,t),O.Am.error(e)}}var ek=l(26109),e_=e=>{let{availableSlices:t,values:l}=e;return(0,n.jsx)(L.F2,{name:"sliceKeys",render:e=>(0,n.jsx)(eT.Z,{gridTemplateMinPx:"200px",elems:t,defineElementKey:e=>"".concat(e.from,"-").concat(e.model.name),renderElem:t=>{let i=l.sliceKeys.includes(t.model.id);return(0,n.jsx)(eC.b,{action:{type:"checkbox"},mode:"selection",onSelectedChange:n=>{n?e.push(t.model.id):e.remove(l.sliceKeys.indexOf(t.model.id))},selected:i,slice:t,variant:"outlined"})}})})};let eL=e=>{let{formId:t,close:l,onSuccess:i,availableSlicesTemplates:a,localLibraries:o,location:r}=e,{createSliceSuccess:s}=(0,f.Z)();return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;ew({templateIDs:t,localLibrariesNames:o.map(e=>e.name),location:r,onSuccess:async e=>{s((await (0,v.y0)()).libraries),i(await Promise.all(e.map(async e=>(await ee.managerClient.slices.readSlice({libraryID:o[0].name,sliceID:e})).model).filter(e=>void 0!==e)))}})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a.map(e=>({extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:ek.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce((e,t)=>({...e,[t[0]]:{url:t[1]}}),{})}))})}})};var eA=e=>{let{formId:t,close:l,onSubmit:i,availableSlices:a}=e;return(0,n.jsx)(_.Z,{isOpen:!0,buttonLabel:"Add",formId:t,close:l,onSubmit:e=>{let{sliceKeys:t}=e;i(t.map(e=>{var t;return null===(t=a.find(t=>t.model.id===e))||void 0===t?void 0:t.model}).filter(e=>void 0!==e))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:e=>{if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:e=>{let{errors:t}=e;return void 0!==t.sliceKeys?(0,n.jsx)(A.xv,{sx:{color:"error"},children:t.sliceKeys}):void 0},children:e=>{let{values:t}=e;return(0,n.jsx)(e_,{values:t,availableSlices:a})}})};let eE=(e,t)=>{let l=(t||[]).reduce((e,t)=>[...e,...t.components],[]),{slicesInSliceZone:n,notFound:i}=e.value.reduce((e,t)=>{let{key:n,value:i}=t;if("SharedSlice"===i.type){let t=l.find(e=>e.model.id===n);return t?{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"SharedSlice",payload:t}]}:{...e,notFound:[...e.notFound,{key:n}]}}return{...e,slicesInSliceZone:[...e.slicesInSliceZone,{type:"Slice",payload:{key:n,value:i}}]}},{slicesInSliceZone:[],notFound:[]});return{availableSlices:l,slicesInSliceZone:n,notFound:i}};var eN=e=>{var t;let{customType:l,onCreateSliceZone:a,onDeleteSliceZone:o,onRemoveSharedSlice:r,sliceZone:d,tabId:m}=e,u=(0,J.QT)(et,[]),[h,p]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),[y,g]=(0,s.useState)(!1),[j,S]=(0,s.useState)(!1),{remoteSlices:C,libraries:T}=(0,c.v9)(e=>({remoteSlices:(0,ei.sT)(e),libraries:(0,ei.Sd)(e),slices:(0,ei.xC)(e)})),{setCustomType:D}=I(),{completeStep:w}=(0,W.k)(),{openLoginModal:_}=(0,f.Z)(),L=(0,H.F)({menuType:"Dropdown"}),A=T.filter(e=>e.isLocal),{availableSlices:E,slicesInSliceZone:N,notFound:M}=(0,s.useMemo)(()=>d?eE(d,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]},[d,T]),[z,Z]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(null==M?void 0:M.length)&&M.forEach(e=>{let{key:t}=e;r(t)})},[M]);let F=N.filter(e=>"SharedSlice"===e.type).map(e=>e.payload),K=E.filter(e=>!F.some(t=>t.model.id===e.model.id)),B=()=>{b(!0)},R=()=>{g(!0)},U=async()=>{await ee.managerClient.user.checkIsLoggedIn()?S(!0):_()},V=()=>{p(!0),v.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:l.id,customTypeFormat:l.format})},X=()=>{b(!1)},G=()=>{g(!1)},ea=()=>{S(!1)},eo=()=>{p(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.Bu,{actions:d?(0,n.jsxs)(i.ar,{children:[(0,n.jsx)(i.av,{children:(0,n.jsx)(i.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,n.jsxs)(i.as,{align:"end",children:[(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromImage.BackgroundIcon,onSelect:()=>void U(),description:L.fromImage.description,children:L.fromImage.title}),(0,n.jsx)(i.at,{renderStartIcon:()=>L.fromScratch.BackgroundIcon,onSelect:R,description:L.fromScratch.description,children:L.fromScratch.title}),u.length>0?(0,n.jsx)(i.at,{onSelect:V,renderStartIcon:()=>L.fromTemplate.BackgroundIcon,description:L.fromTemplate.description,children:L.fromTemplate.title}):void 0,K.length>0?(0,n.jsx)(i.at,{onSelect:B,renderStartIcon:()=>L.fromExisting.BackgroundIcon,description:L.fromExisting.description,children:L.fromExisting.title}):void 0]})]}):void 0,toggle:"page"!==l.format||"Main"!==m?(0,n.jsx)(i.bC,{checked:!!d,onCheckedChange:e=>{e?a():Z(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slices"}),d?N.length>0?(0,n.jsx)(Y.xR,{children:(0,n.jsx)(eD,{slices:N,format:l.format,path:{customTypeID:l.id,tabID:m,sliceZoneID:null!==(t=null==d?void 0:d.key)&&void 0!==t?t:""},onRemoveSharedSlice:r})}):(0,n.jsx)(i.D,{flexDirection:"column",flexGrow:1,justifyContent:"center",alignItems:"center",padding:{block:32},children:(0,n.jsx)(Q,{openUpdateSliceZoneModal:B,openCreateSliceModal:R,openCreateSliceFromImageModal:()=>void U(),openSlicesTemplatesModal:V,projectHasAvailableSlices:K.length>0,isSlicesTemplatesSupported:u.length>0})}):void 0,x&&(0,n.jsx)(eA,{formId:"tab-slicezone-form-".concat(m),availableSlices:K,onSubmit:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success("Slice(s) added to slice zone")}}),w("createSlice"),X()},close:X}),h&&(0,n.jsx)(eL,{formId:"tab-slicezone-form-".concat(m),availableSlicesTemplates:u,localLibraries:A,location:"".concat(l.format,"_type"),onSuccess:e=>{let t=$({customType:l,tabId:m,slices:e});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),w("createSlice"),eo()},close:eo}),z&&(0,n.jsx)(es,{closeDeleteSliceZoneModal:()=>{Z(!1)},deleteSliceZone:()=>{o(),Z(!1)}}),(null==A?void 0:A.length)!==0&&y&&(0,n.jsx)(el.c,{onSuccess:e=>{let t=$({customType:l,tabId:m,slices:[e]});D({customType:k.Dc.fromSM(t),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(A[0].name,"/")}))}}),G()},localLibraries:A,location:"".concat(l.format,"_type"),remoteSlices:C,onClose:G}),(0,n.jsx)(q.S,{open:j,location:"".concat(l.format,"_type"),onSuccess:e=>{let{slices:t,library:i}=e,a=$({customType:l,tabId:m,slices:t.map(e=>e.model)});D({customType:k.Dc.fromSM(a),onSaveCallback:()=>{O.Am.success((0,n.jsx)(en.GX,{message:"Slice(s) added to slice zone and created at: ",path:i}))}}),ea()},onClose:ea})]})};let eM=[K.C.UID,K.C.Image,K.C.Text,K.C.StructuredText,K.C.Link,K.C.Select,K.C.Boolean,K.C.Number,K.C.Color,K.C.Date,K.C.Table,K.C.Embed,K.C.Timestamp,K.C.GeoPoint,K.C.ContentRelationship,K.C.LinkToMedia,K.C.Group,K.C.NestedGroup];var ez=e=>{var t,l,a,o;let{tabId:r}=e,{customType:c,setCustomType:d}=I(),u=k.Dc.toSM(c),h=null===(t=u.tabs.find(e=>e.key===r))||void 0===t?void 0:t.sliceZone,p=null!==(a=null===(l=u.tabs.find(e=>e.key===r))||void 0===l?void 0:l.value)&&void 0!==a?a:[],x="page"===u.format&&u.repeatable?p.filter(e=>"uid"!==e.key):p,v=u.tabs.reduce((e,t)=>[...e,...t.value],[]),b=e=>{var t;let{apiId:l,value:n}=e,i=null===(t=n.config)||void 0===t?void 0:t.label;if((0,B.Ss)(K.C,n.type)||null==i)return;if("Range"===n.type||"IntegrationFields"===n.type||"Separator"===n.type)throw Error("Unsupported Field Type: ".concat(n.type));let a=K.C[n.type];try{a.schema.validateSync(n,{stripUnknown:!1})}catch(e){throw Error('Add field: Model is invalid for field "'.concat(n.type,'".'))}let o=k.L$.fromSM(n);d({customType:(0,m.xS)({customType:c,newField:o,newFieldId:l,sectionId:r}),onSaveCallback:()=>{O.Am.success("".concat("Group"===n.type?"Group":"Field"," added"))}}),(0,U.V)({id:l,field:o})},y=e=>{let{apiId:t,newKey:l,value:n,inGroupFieldAction:i,updateMeta:a}=e;if((0,B.Ss)(K.C,n.type))return;let o=k.L$.fromSM(n);d({customType:(0,m.L4)({customType:c,previousFieldId:t,newFieldId:l,newField:o,sectionId:r}),onSaveCallback:()=>{"add"===i&&O.Am.success("Field added")},updateMeta:a}),i||(0,V.Z)({previousId:t,id:l,field:o})};return(0,n.jsx)(F.S,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.D,{padding:32,children:(0,n.jsx)(i.bg,{})}),children:(0,n.jsxs)(P.aV,{border:!1,style:{flexGrow:1},children:[(0,n.jsx)(G.Z,{zoneType:"customType",zoneTypeFormat:null!==(o=c.format)&&void 0!==o?o:"custom",tabId:r,title:"Static zone",dataTip:"",fields:x,poolOfFieldsToCheck:v,showHints:!0,EditModal:X.Z,widgetsArray:eM,onDeleteItem:e=>{d({customType:(0,m.AK)({customType:c,fieldId:e,sectionId:r})})},onSave:e=>""===e.apiId?b({...e,apiId:e.newKey}):y(e),onDragEnd:e=>{if((0,B.uS)(e))return;let{source:t,destination:l}=e;if(!l)return;let n=(0,m.gR)({customType:c,sourceIndex:t.index,destinationIndex:l.index,sectionId:r});(0,Z.flushSync)(()=>d({customType:n}))},renderHintBase:e=>{let{item:t}=e;return"data".concat((0,R.Ti)(t.key))},renderFieldAccessor:e=>"data".concat((0,R.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:c.repeatable}),(0,n.jsx)(eN,{customType:u,tabId:r,sliceZone:h,onRemoveSharedSlice:e=>{d({customType:(0,m.EN)({customType:c,sectionId:r,sliceId:e})})},onCreateSliceZone:()=>{d({customType:(0,m.Tr)(c,r)})},onDeleteSliceZone:()=>{d({customType:(0,m.E3)(c,r)})}})]})})})};let eZ=()=>{var e,t,l;let{customType:a,setCustomType:o}=I(),r=k.Dc.toSM(a),[c,d]=(0,s.useState)(null===(e=r.tabs[0])||void 0===e?void 0:e.key),[u,h]=(0,s.useState)(),p=(null===(l=r.tabs.find(e=>e.key===c))||void 0===l?void 0:null===(t=l.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i.c9,{sx:p?{flexGrow:1}:void 0,children:["page"===a.format?(0,n.jsx)(i.ca,{title:a.repeatable?(0,n.jsx)(T,{}):void 0}):void 0,(0,n.jsxs)(i.cb,{onValueChange:d,value:c,children:[(0,n.jsx)(i.cd,{onAddNewTab:()=>{h({type:"CREATE_CUSTOM_TYPE_TAB"})},children:r.tabs.map(e=>(0,n.jsx)(i.ce,{menu:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.at,{onSelect:()=>{h({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"edit"}),children:"Rename"}),(0,n.jsx)(i.at,{color:"tomato",disabled:function(e){if(r.tabs.length<=1)return!0;let t=r.tabs.find(e=>e.value.find(e=>"uid"===e.key));return"page"===a.format&&a.repeatable&&(null==t?void 0:t.key)===e}(e.key),onSelect:()=>{h({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,n.jsx)(i.aX,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key))}),r.tabs.map(e=>(0,n.jsx)(i.cc,{value:e.key,children:(0,n.jsx)(ez,{tabId:e.key})},e.key))]})]}),(null==u?void 0:u.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(N,{close:()=>{h(void 0)},isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.vB)(a,t)}),d(t)},tabIds:r.tabs.map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,n.jsx)(z,{close:()=>{h(void 0)},initialTabKey:u.tabKey,isOpen:!0,onSubmit:e=>{let{id:t}=e;o({customType:(0,m.HO)(a,u.tabKey,t)}),c===u.tabKey&&d(t)},tabIds:r.tabs.filter(e=>e.key!==u.tabKey).map(e=>e.key.toLowerCase())}):void 0,(null==u?void 0:u.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,n.jsx)(M,{close:()=>{h(void 0)},isOpen:!0,onSubmit:()=>{if(o({customType:(0,m.F$)(a,u.tabKey)}),c===u.tabKey){var e;let t=null===(e=r.tabs.find(e=>e.key!==u.tabKey))||void 0===e?void 0:e.key;void 0!==t&&d(t)}}}):void 0]})};var eO=l(16442),eP=l(78254),eF=l(60867),eK=l(11166),eB=l(34919),eR=l.n(eB);let eU=e=>{let{tabs:t,...l}=e;return(0,n.jsxs)(eK.fC,{...l,className:eR().root,defaultValue:t[0].label,orientation:"vertical",children:[(0,n.jsx)(eK.aV,{className:eR().list,"aria-label":"content tabs",children:t.map((e,t)=>{let{label:l}=e;return(0,n.jsx)(eK.xz,{className:eR().trigger,value:l,children:(0,n.jsx)(i.bL,{className:eR().triggerText,component:"span",color:"inherit",children:l})},"".concat(l,"-trig").concat(t+1))})}),t.map((e,t)=>{let{label:l,content:a}=e;return(0,n.jsx)(eK.VY,{className:eR().content,value:l,children:(0,n.jsx)(i.bn,{className:eR().scrollArea,children:a})},"".concat(l,"-content").concat(t+1))})]})};var eV=l(25661),eX=l(88241),eG=l(32554),eY=l(44621),eq=l.n(eY);let eH=e=>{var t,l;let{inline:a,...o}=e,r=(0,eG.p)();if(!0===a)return(0,n.jsx)("code",{...o,className:eq().inlineCode});let s=(()=>{var e,t,l,n,i;if((null===(t=o.node)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.meta)!==void 0){let e=null===(n=o.node)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:l.meta;return{fileName:e.substring(1,e.length-1),language:null===(i=o.className)||void 0===i?void 0:i.split("-")[1]}}return null})(),c=null===(t=/language-(\w+)/.exec(null!==(l=o.className)&&void 0!==l?l:""))||void 0===t?void 0:t[1];return(0,n.jsx)(i.W,{...o,onCopy:()=>{v.Xe.track({event:"page-type:copy-snippet",framework:r})},language:c,code:String(o.children).replace(/\n$/,""),title:null==s?void 0:s.fileName})},eQ=e=>{let{markdown:t}=e;return(0,n.jsx)(eV.D,{children:t,linkTarget:"_blank",remarkPlugins:[eX.Z],components:{code:e=>(0,n.jsx)(eH,{...e}),h1:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h1",variant:"h1"}),h2:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h2",variant:"h2"}),h3:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h3",variant:"h3"}),h4:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),h5:e=>(0,n.jsx)(i.bL,{children:e.children,component:"h4",variant:"h4"}),p:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"p",variant:"normal"}),pre:e=>(0,n.jsx)(i.bL,{className:eq().section,children:e.children,component:"pre",variant:"normal"})}})};async function eW(e){let t=JSON.parse(e),{errors:l,documentation:n}=await ee.managerClient.documentation.read({kind:t.kind,data:t.data});if(l.length>0)throw l;return n}var e$=l(65480),eJ=l.n(e$);let e0=e=>{var t;let{model:l}=e,a=(0,eG.p)(),o=(t={kind:"PageSnippet",data:{model:l}},(0,J.QT)(eW,[JSON.stringify(t)])),{completeStep:r}=(0,W.k)();return 0===o.length?null:(0,n.jsxs)(i.ae,{size:"small",trigger:(0,n.jsx)(i.E,{color:"grey",onClick:()=>{r("codePage"),v.Xe.track({event:"page-type:open-snippet",framework:a})},startIcon:"code",children:"Page snippet"}),children:[(0,n.jsx)(i.al,{icon:"code",title:"Page snippet"}),(0,n.jsx)("section",{className:eJ().content,children:o.length>1?(0,n.jsx)(eU,{style:{flex:1},tabs:o.map((e,t)=>{let{label:l,content:i}=e;return{label:null!=l?l:"Tab ".concat(t+1),content:(0,n.jsx)(eQ,{markdown:i})}})}):(0,n.jsx)(i.bn,{style:{flex:1,padding:16},children:(0,n.jsx)(eQ,{markdown:o[0].content})})})]})},e1=e=>{let{model:t}=e;return(0,n.jsx)("div",{children:(0,n.jsx)(F.S,{children:(0,n.jsx)(s.Suspense,{fallback:(0,n.jsx)(i.E,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,n.jsx)(e0,{model:t})})})})},e4=()=>{let e=(0,r.useRouter)(),{selectedCustomType:t}=(0,c.v9)(t=>({selectedCustomType:(0,eP.Jk)(t,(0,h.Ag)(e.query))}));return((0,s.useEffect)(()=>{t&&(0,eO.TG)(t)||e.replace("/")},[t,e]),t&&(0,eO.TG)(t))?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsxs)("title",{children:[t.local.label," - Slice Machine"]})}),(0,n.jsx)(e8,{customType:t.local})]}):(0,n.jsx)(p.LN,{})},e8=e=>{let{customType:t}=e;return null===t?(0,n.jsx)(p.LN,{}):(0,n.jsx)(p.LN,{children:(0,n.jsx)(S,{initialCustomType:k.Dc.fromSM(t),children:e=>{var l;let{actionQueueStatus:a,customType:o,setCustomType:r}=e,s=(0,m.y6)(o),c=h.cd[t.format],x=g.$[t.format];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(p.wd,{children:[(0,n.jsx)(p.Xq,{url:c.tablePagePathname}),(0,n.jsxs)(p.Cx,{children:[(0,n.jsx)(d.g,{children:x.name({start:!0,plural:!0})}),(0,n.jsx)(d.g,{active:!0,children:null!==(l=o.label)&&void 0!==l?l:o.id})]}),(0,n.jsxs)(p.K2,{children:[(0,n.jsx)(u.X,{status:a}),"page"===o.format?(0,n.jsx)(e1,{model:o}):void 0,(0,n.jsx)(eF._,{isChangesLocal:!0,format:s,customType:o,setLocalCustomType:r})]})]}),(0,n.jsx)(p.RN,{children:(0,n.jsx)(i.D,{flexDirection:"column",minWidth:0,children:(0,n.jsx)(eZ,{})})})]})}})})}},84879:function(e,t,l){"use strict";l.d(t,{E:function(){return o}});var n=l(18566),i=l(80148);async function a(){return i.managerClient.project.getSliceMachineConfig()}function o(e){var t,l;let[o,r]=[(0,n.QT)(a,[]),async e=>{await i.managerClient.project.writeSliceMachineConfig({config:e}),(0,n.VA)(a,[],e)}],s=async t=>{let l={...o,labs:{...o.labs}};t?l.labs[e]=t:e in l.labs&&delete l.labs[e],0===Object.keys(l.labs).length&&delete l.labs,await r(l)};return[{enabled:null!==(l=null==o?void 0:null===(t=o.labs)||void 0===t?void 0:t[e])&&void 0!==l&&l},s]}},34919:function(e){e.exports={flex:"ContentTabs_flex__T21Oc",column:"ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",root:"ContentTabs_root__Gn3Zg ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",list:"ContentTabs_list__rAZtl ContentTabs_flex__T21Oc",trigger:"ContentTabs_trigger__cTyPN ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",triggerText:"ContentTabs_triggerText__p_ZBl",content:"ContentTabs_content__H1Stj ContentTabs_column__1f8b8 ContentTabs_flex__T21Oc",scrollArea:"ContentTabs_scrollArea__DuDcQ"}},65480:function(e){e.exports={content:"PageSnippetDialog_content__jIN6d"}},44621:function(e){e.exports={section:"MarkdownRenderer_section__uNS1M",inlineCode:"MarkdownRenderer_inlineCode__lmGTi"}},65375:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__xf3vM",label:"ConvertLegacySliceButton_label__BK0Gd"}}}]);
|