sanity-plugin-taxonomy-manager 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineField as o,defineType as i,defineArrayMember as a,definePlugin as s}from"sanity";import{usePaneRouter as c,structureTool as l}from"sanity/structure";import{jsxs as d,jsx as p,Fragment as h}from"react/jsx-runtime";import{InfoOutlineIcon as u,ToggleArrowRightIcon as f,SquareIcon as m,AddCircleIcon as g,TrashIcon as y,ErrorOutlineIcon as b,AddIcon as v,EditIcon as w,WarningOutlineIcon as C}from"@sanity/icons";import{randomKey as _}from"@sanity/util/content";import{AiOutlineTags as S,AiOutlineTag as k}from"react-icons/ai";import x,{useRef as I,useDebugValue as N,createElement as O,useContext as P,useCallback as E,useState as $,useEffect as T,useMemo as A,createContext as V}from"react";import{hues as R}from"@sanity/color";import{Stack as M,Text as z,useToast as H,Inline as L,Button as D,Card as j,Dialog as U,Box as F,Label as B,Tooltip as q,TextInput as G,TextArea as Z,Flex as W,Spinner as Y,Container as K,Grid as X}from"@sanity/ui";import J from"react-fast-compare";import{distinctUntilChanged as Q,catchError as ee}from"rxjs/operators";import{RouterContext as te}from"sanity/router";var ne=function(){return ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ne.apply(this,arguments)};function re(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)(r||!(o in t))&&(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function oe(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var ie=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,ae=oe((function(e){return ie.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),se="-ms-",ce="-moz-",le="-webkit-",de="comm",pe="rule",he="decl",ue="@import",fe="@keyframes",me="@layer",ge=Math.abs,ye=String.fromCharCode,be=Object.assign;function ve(e){return e.trim()}function we(e,t){return(e=t.exec(e))?e[0]:e}function Ce(e,t,n){return e.replace(t,n)}function _e(e,t,n){return e.indexOf(t,n)}function Se(e,t){return 0|e.charCodeAt(t)}function ke(e,t,n){return e.slice(t,n)}function xe(e){return e.length}function Ie(e){return e.length}function Ne(e,t){return t.push(e),e}function Oe(e,t){return e.filter((function(e){return!we(e,t)}))}var Pe=1,Ee=1,$e=0,Te=0,Ae=0,Ve="";function Re(e,t,n,r,o,i,a,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Pe,column:Ee,length:a,return:"",siblings:s}}function Me(e,t){return be(Re("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function ze(e){for(;e.root;)e=Me(e.root,{children:[e]});Ne(e,e.siblings)}function He(){return Ae=Te<$e?Se(Ve,Te++):0,Ee++,10===Ae&&(Ee=1,Pe++),Ae}function Le(){return Se(Ve,Te)}function De(){return Te}function je(e,t){return ke(Ve,e,t)}function Ue(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Fe(e){return ve(je(Te-1,Ge(91===e?e+2:40===e?e+1:e)))}function Be(e){for(;(Ae=Le())&&Ae<33;)He();return Ue(e)>2||Ue(Ae)>3?"":" "}function qe(e,t){for(;--t&&He()&&!(Ae<48||Ae>102||Ae>57&&Ae<65||Ae>70&&Ae<97););return je(e,De()+(t<6&&32==Le()&&32==He()))}function Ge(e){for(;He();)switch(Ae){case e:return Te;case 34:case 39:34!==e&&39!==e&&Ge(Ae);break;case 40:41===e&&Ge(e);break;case 92:He()}return Te}function Ze(e,t){for(;He()&&e+Ae!==57&&(e+Ae!==84||47!==Le()););return"/*"+je(t,Te-1)+"*"+ye(47===e?e:He())}function We(e){for(;!Ue(Le());)He();return je(e,Te)}function Ye(e){return function(e){return Ve="",e}(Ke("",null,null,null,[""],e=function(e){return Pe=Ee=1,$e=xe(Ve=e),Te=0,[]}(e),0,[0],e))}function Ke(e,t,n,r,o,i,a,s,c){for(var l=0,d=0,p=a,h=0,u=0,f=0,m=1,g=1,y=1,b=0,v="",w=o,C=i,_=r,S=v;g;)switch(f=b,b=He()){case 40:if(108!=f&&58==Se(S,p-1)){-1!=_e(S+=Ce(Fe(b),"&","&\f"),"&\f",ge(l?s[l-1]:0))&&(y=-1);break}case 34:case 39:case 91:S+=Fe(b);break;case 9:case 10:case 13:case 32:S+=Be(f);break;case 92:S+=qe(De()-1,7);continue;case 47:switch(Le()){case 42:case 47:Ne(Je(Ze(He(),De()),t,n,c),c);break;default:S+="/"}break;case 123*m:s[l++]=xe(S)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+d:-1==y&&(S=Ce(S,/\f/g,"")),u>0&&xe(S)-p&&Ne(u>32?Qe(S+";",r,n,p-1,c):Qe(Ce(S," ","")+";",r,n,p-2,c),c);break;case 59:S+=";";default:if(Ne(_=Xe(S,t,n,l,d,o,s,v,w=[],C=[],p,i),i),123===b)if(0===d)Ke(S,t,_,_,w,i,p,s,C);else switch(99===h&&110===Se(S,3)?100:h){case 100:case 108:case 109:case 115:Ke(e,_,_,r&&Ne(Xe(e,_,_,0,0,o,s,v,o,w=[],p,C),C),o,C,p,s,r?w:C);break;default:Ke(S,_,_,_,[""],C,0,s,C)}}l=d=u=0,m=y=1,v=S="",p=a;break;case 58:p=1+xe(S),u=f;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==(Ae=Te>0?Se(Ve,--Te):0,Ee--,10===Ae&&(Ee=1,Pe--),Ae))continue;switch(S+=ye(b),b*m){case 38:y=d>0?1:(S+="\f",-1);break;case 44:s[l++]=(xe(S)-1)*y,y=1;break;case 64:45===Le()&&(S+=Fe(He())),h=Le(),d=p=xe(v=S+=We(De())),b++;break;case 45:45===f&&2==xe(S)&&(m=0)}}return i}function Xe(e,t,n,r,o,i,a,s,c,l,d,p){for(var h=o-1,u=0===o?i:[""],f=Ie(u),m=0,g=0,y=0;m<r;++m)for(var b=0,v=ke(e,h+1,h=ge(g=a[m])),w=e;b<f;++b)(w=ve(g>0?u[b]+" "+v:Ce(v,/&\f/g,u[b])))&&(c[y++]=w);return Re(e,t,n,0===o?pe:s,c,l,d,p)}function Je(e,t,n,r){return Re(e,t,n,de,ye(Ae),ke(e,2,-2),0,r)}function Qe(e,t,n,r,o){return Re(e,t,n,he,ke(e,0,r),ke(e,r+1,-1),r,o)}function et(e,t,n){switch(function(e,t){return 45^Se(e,0)?(((t<<2^Se(e,0))<<2^Se(e,1))<<2^Se(e,2))<<2^Se(e,3):0}(e,t)){case 5103:return le+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return le+e+e;case 4789:return ce+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return le+e+ce+e+se+e+e;case 5936:switch(Se(e,t+11)){case 114:return le+e+se+Ce(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return le+e+se+Ce(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return le+e+se+Ce(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return le+e+se+e+e;case 6165:return le+e+se+"flex-"+e+e;case 5187:return le+e+Ce(e,/(\w+).+(:[^]+)/,le+"box-$1$2"+se+"flex-$1$2")+e;case 5443:return le+e+se+"flex-item-"+Ce(e,/flex-|-self/g,"")+(we(e,/flex-|baseline/)?"":se+"grid-row-"+Ce(e,/flex-|-self/g,""))+e;case 4675:return le+e+se+"flex-line-pack"+Ce(e,/align-content|flex-|-self/g,"")+e;case 5548:return le+e+se+Ce(e,"shrink","negative")+e;case 5292:return le+e+se+Ce(e,"basis","preferred-size")+e;case 6060:return le+"box-"+Ce(e,"-grow","")+le+e+se+Ce(e,"grow","positive")+e;case 4554:return le+Ce(e,/([^-])(transform)/g,"$1"+le+"$2")+e;case 6187:return Ce(Ce(Ce(e,/(zoom-|grab)/,le+"$1"),/(image-set)/,le+"$1"),e,"")+e;case 5495:case 3959:return Ce(e,/(image-set\([^]*)/,le+"$1$`$1");case 4968:return Ce(Ce(e,/(.+:)(flex-)?(.*)/,le+"box-pack:$3"+se+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+le+e+e;case 4200:if(!we(e,/flex-|baseline/))return se+"grid-column-align"+ke(e,t)+e;break;case 2592:case 3360:return se+Ce(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,we(e.props,/grid-\w+-end/)}))?~_e(e+(n=n[t].value),"span",0)?e:se+Ce(e,"-start","")+e+se+"grid-row-span:"+(~_e(n,"span",0)?we(n,/\d+/):+we(n,/\d+/)-+we(e,/\d+/))+";":se+Ce(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return we(e.props,/grid-\w+-start/)}))?e:se+Ce(Ce(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Ce(e,/(.+)-inline(.+)/,le+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(xe(e)-1-t>6)switch(Se(e,t+1)){case 109:if(45!==Se(e,t+4))break;case 102:return Ce(e,/(.+:)(.+)-([^]+)/,"$1"+le+"$2-$3$1"+ce+(108==Se(e,t+3)?"$3":"$2-$3"))+e;case 115:return~_e(e,"stretch",0)?et(Ce(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Ce(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,i,a,s){return se+n+":"+r+s+(o?se+n+"-span:"+(i?a:+a-+r)+s:"")+e}));case 4949:if(121===Se(e,t+6))return Ce(e,":",":"+le)+e;break;case 6444:switch(Se(e,45===Se(e,14)?18:11)){case 120:return Ce(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+le+(45===Se(e,14)?"inline-":"")+"box$3$1"+le+"$2$3$1"+se+"$2box$3")+e;case 100:return Ce(e,":",":"+se)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ce(e,"scroll-","scroll-snap-")+e}return e}function tt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function nt(e,t,n,r){switch(e.type){case me:if(e.children.length)break;case ue:case he:return e.return=e.return||e.value;case de:return"";case fe:return e.return=e.value+"{"+tt(e.children,r)+"}";case pe:if(!xe(e.value=e.props.join(",")))return""}return xe(n=tt(e.children,r))?e.return=e.value+"{"+n+"}":""}function rt(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case he:return void(e.return=et(e.value,e.length,n));case fe:return tt([Me(e,{value:Ce(e.value,"@","@"+le)})],r);case pe:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(we(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ze(Me(e,{props:[Ce(t,/:(read-\w+)/,":"+ce+"$1")]})),ze(Me(e,{props:[t]})),be(e,{props:Oe(n,r)});break;case"::placeholder":ze(Me(e,{props:[Ce(t,/:(plac\w+)/,":"+le+"input-$1")]})),ze(Me(e,{props:[Ce(t,/:(plac\w+)/,":"+ce+"$1")]})),ze(Me(e,{props:[Ce(t,/:(plac\w+)/,se+"input-$1")]})),ze(Me(e,{props:[t]})),be(e,{props:Oe(n,r)})}return""}))}}var ot={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},it=typeof process<"u"&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",at="active",st="data-styled-version",ct="6.1.12",lt="/*!sc*/\n",dt=typeof window<"u"&&"HTMLElement"in window,pt=!!("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),ht=/invalid hook call/i,ut=new Set,ft=Object.freeze([]),mt=Object.freeze({});var gt=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),yt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,bt=/(^-|-$)/g;function vt(e){return e.replace(yt,"-").replace(bt,"")}var wt=/(a)(d)/gi,Ct=52,_t=function(e){return String.fromCharCode(e+(e>25?39:97))};function St(e){var t,n="";for(t=Math.abs(e);t>Ct;t=t/Ct|0)n=_t(t%Ct)+n;return(_t(t%Ct)+n).replace(wt,"$1-$2")}var kt,xt=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},It=function(e){return xt(5381,e)};function Nt(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Ot(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Pt="function"==typeof Symbol&&Symbol.for,Et=Pt?Symbol.for("react.memo"):60115,$t=Pt?Symbol.for("react.forward_ref"):60112,Tt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},At={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Vt={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Rt=((kt={})[$t]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kt[Et]=Vt,kt);function Mt(e){return("type"in(t=e)&&t.type.$$typeof)===Et?Vt:"$$typeof"in e?Rt[e.$$typeof]:Tt;var t}var zt=Object.defineProperty,Ht=Object.getOwnPropertyNames,Lt=Object.getOwnPropertySymbols,Dt=Object.getOwnPropertyDescriptor,jt=Object.getPrototypeOf,Ut=Object.prototype;function Ft(e,t,n){if("string"!=typeof t){if(Ut){var r=jt(t);r&&r!==Ut&&Ft(e,r,n)}var o=Ht(t);Lt&&(o=o.concat(Lt(t)));for(var i=Mt(e),a=Mt(t),s=0;s<o.length;++s){var c=o[s];if(!(c in At||n&&n[c]||a&&c in a||i&&c in i)){var l=Dt(t,c);try{zt(e,c,l)}catch{}}}}return e}function Bt(e){return"function"==typeof e}function qt(e){return"object"==typeof e&&"styledComponentId"in e}function Gt(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Zt(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function Wt(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Yt(e,t,n){if(void 0===n&&(n=!1),!n&&!Wt(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Yt(e[r],t[r]);else if(Wt(t))for(var r in t)e[r]=Yt(e[r],t[r]);return e}function Kt(e,t){Object.defineProperty(e,"toString",{value:t})}var Xt="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function Jt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,i=e.length;o<i;o+=1)r.push(e[o]);return r.forEach((function(e){n=n.replace(/%[a-z]/,e)})),n}function Qt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(Jt.apply(void 0,re([Xt[e]],t,!1)).trim())}var en=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw Qt(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i<o;i++)this.groupSizes[i]=0}for(var a=this.indexOfGroup(e+1),s=(i=0,t.length);i<s;i++)this.tag.insertRule(a,t[i])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i<o;i++)t+="".concat(this.tag.getRule(i)).concat(lt);return t},e}(),tn=1<<30,nn=new Map,rn=new Map,on=1,an=function(e){if(nn.has(e))return nn.get(e);for(;rn.has(on);)on++;var t=on++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>tn))throw Qt(16,"".concat(t));return nn.set(e,t),rn.set(t,e),t},sn=function(e,t){on=t+1,nn.set(e,t),rn.set(t,e)},cn="style[".concat(it,"][").concat(st,'="').concat(ct,'"]'),ln=new RegExp("^".concat(it,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),dn=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i<a;i++)(r=o[i])&&e.registerName(t,r)},pn=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(lt),o=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var c=s.match(ln);if(c){var l=0|parseInt(c[1],10),d=c[2];0!==l&&(sn(d,l),dn(e,d,c[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(s)}}},hn=function(e){for(var t=document.querySelectorAll(cn),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(it)!==at&&(pn(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var un=function(e){var t,n,r=document.head,o=e||r,i=document.createElement("style"),a=(t=o,(n=Array.from(t.querySelectorAll("style[".concat(it,"]"))))[n.length-1]),s=void 0!==a?a.nextSibling:null;i.setAttribute(it,at),i.setAttribute(st,ct);var c=typeof __webpack_nonce__<"u"?__webpack_nonce__:null;return c&&i.setAttribute("nonce",c),o.insertBefore(i,s),i},fn=function(){function e(e){this.element=un(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw Qt(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),mn=function(){function e(e){this.element=un(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),gn=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),yn=dt,bn={isServer:!dt,useCSSOMInjection:!pt},vn=function(){function e(e,t,n){void 0===e&&(e=mt),void 0===t&&(t={});var r=this;this.options=ne(ne({},bn),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&dt&&yn&&(yn=!1,hn(this)),Kt(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o,i=(o=n,rn.get(o));if(void 0===i)return"continue";var a=e.names.get(i),s=t.getGroup(n);if(void 0===a||!a.size||0===s.length)return"continue";var c="".concat(it,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==a&&a.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(s).concat(c,'{content:"').concat(l,'"}').concat(lt)},i=0;i<n;i++)o(i);return r}(r)}))}return e.registerId=function(e){return an(e)},e.prototype.rehydrate=function(){!this.server&&dt&&hn(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(ne(ne({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=this.options,t=e.useCSSOMInjection,n=e.target,r=e.isServer?new gn(n):t?new fn(n):new mn(n),new en(r)));var e,t,n,r},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(an(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(an(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(an(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),wn=/&/g,Cn=/^\s*\/\/.*$/gm;function _n(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=_n(e.children,t)),e}))}var Sn=new vn,kn=function(){var e,t,n,r=mt,o=r.options,i=void 0===o?mt:o,a=r.plugins,s=void 0===a?ft:a,c=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},l=s.slice();l.push((function(e){e.type===pe&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(wn,t).replace(n,c))})),i.prefix&&l.push(rt),l.push(nt);var d=function(r,o,a,s){void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s="&"),e=s,t=o,n=new RegExp("\\".concat(t,"\\b"),"g");var c=r.replace(Cn,""),d=Ye(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);i.namespace&&(d=_n(d,i.namespace));var p,h,u,f=[];return tt(d,(p=l.concat((u=function(e){return f.push(e)},function(e){e.root||(e=e.return)&&u(e)})),h=Ie(p),function(e,t,n,r){for(var o="",i=0;i<h;i++)o+=p[i](e,t,n,r)||"";return o})),f};return d.hash=s.length?s.reduce((function(e,t){return t.name||Qt(15),xt(e,t.name)}),5381).toString():"",d}(),xn=x.createContext({shouldForwardProp:void 0,styleSheet:Sn,stylis:kn});function In(){return P(xn)}x.createContext(void 0);var Nn=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=kn);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Kt(this,(function(){throw Qt(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=kn),this.name+e.hash},e}(),On=function(e){return e>="A"&&e<="Z"};function Pn(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;On(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var En=function(e){return null==e||!1===e||""===e},$n=function(e){var t,n,r=[];for(var o in e){var i=e[o];e.hasOwnProperty(o)&&!En(i)&&(Array.isArray(i)&&i.isCss||Bt(i)?r.push("".concat(Pn(o),":"),i,";"):Wt(i)?r.push.apply(r,re(re(["".concat(o," {")],$n(i),!1),["}"],!1)):r.push("".concat(Pn(o),": ").concat((t=o,null==(n=i)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in ot||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Tn(e,t,n,r){if(En(e))return[];if(qt(e))return[".".concat(e.styledComponentId)];if(Bt(e)){if(!Bt(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Nn||Wt(o)||null===o||console.error("".concat(Nt(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Tn(o,t,n,r)}var i;return e instanceof Nn?n?(e.inject(n,r),[e.getName(r)]):[e]:Wt(e)?$n(e):Array.isArray(e)?Array.prototype.concat.apply(ft,e.map((function(e){return Tn(e,t,n,r)}))):[e.toString()]}var An=It(ct),Vn=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Bt(n)&&!qt(n))return!1}return!0}(e),this.componentId=t,this.baseHash=xt(An,t),this.baseStyle=n,vn.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=Gt(r,this.staticRulesId);else{var o=Zt(Tn(this.rules,e,t,n)),i=St(xt(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,i)){var a=n(o,".".concat(i),void 0,this.componentId);t.insertRules(this.componentId,i,a)}r=Gt(r,i),this.staticRulesId=i}else{for(var s=xt(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var d=this.rules[l];if("string"==typeof d)c+=d,"production"!==process.env.NODE_ENV&&(s=xt(s,d));else if(d){var p=Zt(Tn(d,e,t,n));s=xt(s,p+l),c+=p}}if(c){var h=St(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(c,".".concat(h),void 0,this.componentId)),r=Gt(r,h)}}return r},e}(),Rn=x.createContext(void 0),Mn={},zn=new Set;function Hn(e,t,n){var r,o=qt(e),i=e,a=!Ot(e),s=t.attrs,c=void 0===s?ft:s,l=t.componentId,d=void 0===l?function(e,t){var n="string"!=typeof e?"sc":vt(e);Mn[n]=(Mn[n]||0)+1;var r="".concat(n,"-").concat(function(e){return St(It(e)>>>0)}(ct+n+Mn[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):l,p=t.displayName,h=void 0===p?Ot(r=e)?"styled.".concat(r):"Styled(".concat(Nt(r),")"):p,u=t.displayName&&t.componentId?"".concat(vt(t.displayName),"-").concat(t.componentId):t.componentId||d,f=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,m=t.shouldForwardProp;if(o&&i.shouldForwardProp){var g=i.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;m=function(e,t){return g(e,t)&&y(e,t)}}else m=g}var b=new Vn(n,u,o?i.componentStyle:void 0);function v(e,t){return function(e,t,n){var r=e.attrs,o=e.componentStyle,i=e.defaultProps,a=e.foldedComponentIds,s=e.styledComponentId,c=e.target,l=x.useContext(Rn),d=In(),p=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&N(s);var h=function(e,t,n){return void 0===n&&(n=mt),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,i)||mt,u=function(e,t,n){for(var r,o=ne(ne({},t),{className:void 0,theme:n}),i=0;i<e.length;i+=1){var a=Bt(r=e[i])?r(o):r;for(var s in a)o[s]="className"===s?Gt(o[s],a[s]):"style"===s?ne(ne({},o[s]),a[s]):a[s]}return t.className&&(o.className=Gt(o.className,t.className)),o}(r,t,h),f=u.as||c,m={};for(var g in u)void 0===u[g]||"$"===g[0]||"as"===g||"theme"===g&&u.theme===h||("forwardedAs"===g?m.as=u.forwardedAs:p&&!p(g,f)||(m[g]=u[g],p||"development"!==process.env.NODE_ENV||ae(g)||zn.has(g)||!gt.has(f)||(zn.add(g),console.warn('styled-components: it looks like an unknown prop "'.concat(g,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var y,b,v,w,C=(y=o,b=u,v=In(),w=y.generateAndInjectStyles(b,v.styleSheet,v.stylis),"production"!==process.env.NODE_ENV&&N(w),w);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(C);var _=Gt(a,s);return C&&(_+=" "+C),u.className&&(_+=" "+u.className),m[Ot(f)&&!gt.has(f)?"class":"className"]=_,m.ref=n,O(f,m)}(w,e,t)}v.displayName=h;var w=x.forwardRef(v);return w.attrs=f,w.componentStyle=b,w.displayName=h,w.shouldForwardProp=m,w.foldedComponentIds=o?Gt(i.foldedComponentIds,i.styledComponentId):"",w.styledComponentId=u,w.target=o?i.target:e,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=o?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Yt(e,o[r],!0);return e}({},i.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(function(e,t){if("production"!==process.env.NODE_ENV){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",o=console.error;try{var i=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ht.test(e)?(i=!1,ut.delete(r)):o.apply(void 0,re([e],t,!1))},I(),i&&!ut.has(r)&&(console.warn(r),ut.add(r))}catch(e){ht.test(e.message)&&ut.delete(r)}finally{console.error=o}}}(h,u),w.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var i=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(i,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(h,u)),Kt(w,(function(){return".".concat(w.styledComponentId)})),a&&Ft(w,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function Ln(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var Dn=function(e){return Object.assign(e,{isCss:!0})};function jn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Bt(e)||Wt(e))return Dn(Tn(Ln(ft,re([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Tn(r):Dn(Tn(Ln(r,t)))}function Un(e,t,n){if(void 0===n&&(n=mt),!t)throw Qt(1,t);var r=function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];return e(t,n,jn.apply(void 0,re([r],o,!1)))};return r.attrs=function(r){return Un(e,t,ne(ne({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Un(e,t,ne(ne({},n),r))},r}var Fn=function(e){return Un(Hn,e)},Bn=Fn;gt.forEach((function(e){Bn[e]=Fn(e)})),"production"!==process.env.NODE_ENV&&typeof navigator<"u"&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var qn="__sc-".concat(it,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&typeof window<"u"&&(window[qn]||(window[qn]=0),1===window[qn]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[qn]+=1);const Gn=Bn.details`
1
+ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,unset as o,defineField as i,defineType as a,defineArrayMember as s,definePlugin as c}from"sanity";import{usePaneRouter as l,structureTool as d}from"sanity/structure";import{jsxs as p,jsx as h,Fragment as u}from"react/jsx-runtime";import{InfoOutlineIcon as f,ToggleArrowRightIcon as m,SquareIcon as g,AddCircleIcon as y,TrashIcon as b,ErrorOutlineIcon as v,AddIcon as w,CheckmarkCircleIcon as C,EditIcon as _,WarningOutlineIcon as S}from"@sanity/icons";import{randomKey as k}from"@sanity/util/content";import{AiOutlineTags as x,AiOutlineTag as I}from"react-icons/ai";import N,{useRef as O,useDebugValue as E,createElement as P,useContext as $,useCallback as T,useState as A,useEffect as R,useMemo as V,createContext as M}from"react";import{hues as z}from"@sanity/color";import{Stack as H,Text as D,useToast as L,Inline as j,Button as U,Card as F,Dialog as B,Box as q,Label as G,Tooltip as Z,TextInput as W,TextArea as Y,Flex as K,Spinner as X,Container as J,Grid as Q}from"@sanity/ui";import ee from"react-fast-compare";import{distinctUntilChanged as te,catchError as ne}from"rxjs/operators";import{RouterContext as re}from"sanity/router";var oe=function(){return oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},oe.apply(this,arguments)};function ie(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)(r||!(o in t))&&(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function ae(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var se=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,ce=ae((function(e){return se.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),le="-ms-",de="-moz-",pe="-webkit-",he="comm",ue="rule",fe="decl",me="@import",ge="@keyframes",ye="@layer",be=Math.abs,ve=String.fromCharCode,we=Object.assign;function Ce(e){return e.trim()}function _e(e,t){return(e=t.exec(e))?e[0]:e}function Se(e,t,n){return e.replace(t,n)}function ke(e,t,n){return e.indexOf(t,n)}function xe(e,t){return 0|e.charCodeAt(t)}function Ie(e,t,n){return e.slice(t,n)}function Ne(e){return e.length}function Oe(e){return e.length}function Ee(e,t){return t.push(e),e}function Pe(e,t){return e.filter((function(e){return!_e(e,t)}))}var $e=1,Te=1,Ae=0,Re=0,Ve=0,Me="";function ze(e,t,n,r,o,i,a,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:$e,column:Te,length:a,return:"",siblings:s}}function He(e,t){return we(ze("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function De(e){for(;e.root;)e=He(e.root,{children:[e]});Ee(e,e.siblings)}function Le(){return Ve=Re<Ae?xe(Me,Re++):0,Te++,10===Ve&&(Te=1,$e++),Ve}function je(){return xe(Me,Re)}function Ue(){return Re}function Fe(e,t){return Ie(Me,e,t)}function Be(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function qe(e){return Ce(Fe(Re-1,We(91===e?e+2:40===e?e+1:e)))}function Ge(e){for(;(Ve=je())&&Ve<33;)Le();return Be(e)>2||Be(Ve)>3?"":" "}function Ze(e,t){for(;--t&&Le()&&!(Ve<48||Ve>102||Ve>57&&Ve<65||Ve>70&&Ve<97););return Fe(e,Ue()+(t<6&&32==je()&&32==Le()))}function We(e){for(;Le();)switch(Ve){case e:return Re;case 34:case 39:34!==e&&39!==e&&We(Ve);break;case 40:41===e&&We(e);break;case 92:Le()}return Re}function Ye(e,t){for(;Le()&&e+Ve!==57&&(e+Ve!==84||47!==je()););return"/*"+Fe(t,Re-1)+"*"+ve(47===e?e:Le())}function Ke(e){for(;!Be(je());)Le();return Fe(e,Re)}function Xe(e){return function(e){return Me="",e}(Je("",null,null,null,[""],e=function(e){return $e=Te=1,Ae=Ne(Me=e),Re=0,[]}(e),0,[0],e))}function Je(e,t,n,r,o,i,a,s,c){for(var l=0,d=0,p=a,h=0,u=0,f=0,m=1,g=1,y=1,b=0,v="",w=o,C=i,_=r,S=v;g;)switch(f=b,b=Le()){case 40:if(108!=f&&58==xe(S,p-1)){-1!=ke(S+=Se(qe(b),"&","&\f"),"&\f",be(l?s[l-1]:0))&&(y=-1);break}case 34:case 39:case 91:S+=qe(b);break;case 9:case 10:case 13:case 32:S+=Ge(f);break;case 92:S+=Ze(Ue()-1,7);continue;case 47:switch(je()){case 42:case 47:Ee(et(Ye(Le(),Ue()),t,n,c),c);break;default:S+="/"}break;case 123*m:s[l++]=Ne(S)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+d:-1==y&&(S=Se(S,/\f/g,"")),u>0&&Ne(S)-p&&Ee(u>32?tt(S+";",r,n,p-1,c):tt(Se(S," ","")+";",r,n,p-2,c),c);break;case 59:S+=";";default:if(Ee(_=Qe(S,t,n,l,d,o,s,v,w=[],C=[],p,i),i),123===b)if(0===d)Je(S,t,_,_,w,i,p,s,C);else switch(99===h&&110===xe(S,3)?100:h){case 100:case 108:case 109:case 115:Je(e,_,_,r&&Ee(Qe(e,_,_,0,0,o,s,v,o,w=[],p,C),C),o,C,p,s,r?w:C);break;default:Je(S,_,_,_,[""],C,0,s,C)}}l=d=u=0,m=y=1,v=S="",p=a;break;case 58:p=1+Ne(S),u=f;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==(Ve=Re>0?xe(Me,--Re):0,Te--,10===Ve&&(Te=1,$e--),Ve))continue;switch(S+=ve(b),b*m){case 38:y=d>0?1:(S+="\f",-1);break;case 44:s[l++]=(Ne(S)-1)*y,y=1;break;case 64:45===je()&&(S+=qe(Le())),h=je(),d=p=Ne(v=S+=Ke(Ue())),b++;break;case 45:45===f&&2==Ne(S)&&(m=0)}}return i}function Qe(e,t,n,r,o,i,a,s,c,l,d,p){for(var h=o-1,u=0===o?i:[""],f=Oe(u),m=0,g=0,y=0;m<r;++m)for(var b=0,v=Ie(e,h+1,h=be(g=a[m])),w=e;b<f;++b)(w=Ce(g>0?u[b]+" "+v:Se(v,/&\f/g,u[b])))&&(c[y++]=w);return ze(e,t,n,0===o?ue:s,c,l,d,p)}function et(e,t,n,r){return ze(e,t,n,he,ve(Ve),Ie(e,2,-2),0,r)}function tt(e,t,n,r,o){return ze(e,t,n,fe,Ie(e,0,r),Ie(e,r+1,-1),r,o)}function nt(e,t,n){switch(function(e,t){return 45^xe(e,0)?(((t<<2^xe(e,0))<<2^xe(e,1))<<2^xe(e,2))<<2^xe(e,3):0}(e,t)){case 5103:return pe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pe+e+e;case 4789:return de+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return pe+e+de+e+le+e+e;case 5936:switch(xe(e,t+11)){case 114:return pe+e+le+Se(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return pe+e+le+Se(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return pe+e+le+Se(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return pe+e+le+e+e;case 6165:return pe+e+le+"flex-"+e+e;case 5187:return pe+e+Se(e,/(\w+).+(:[^]+)/,pe+"box-$1$2"+le+"flex-$1$2")+e;case 5443:return pe+e+le+"flex-item-"+Se(e,/flex-|-self/g,"")+(_e(e,/flex-|baseline/)?"":le+"grid-row-"+Se(e,/flex-|-self/g,""))+e;case 4675:return pe+e+le+"flex-line-pack"+Se(e,/align-content|flex-|-self/g,"")+e;case 5548:return pe+e+le+Se(e,"shrink","negative")+e;case 5292:return pe+e+le+Se(e,"basis","preferred-size")+e;case 6060:return pe+"box-"+Se(e,"-grow","")+pe+e+le+Se(e,"grow","positive")+e;case 4554:return pe+Se(e,/([^-])(transform)/g,"$1"+pe+"$2")+e;case 6187:return Se(Se(Se(e,/(zoom-|grab)/,pe+"$1"),/(image-set)/,pe+"$1"),e,"")+e;case 5495:case 3959:return Se(e,/(image-set\([^]*)/,pe+"$1$`$1");case 4968:return Se(Se(e,/(.+:)(flex-)?(.*)/,pe+"box-pack:$3"+le+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pe+e+e;case 4200:if(!_e(e,/flex-|baseline/))return le+"grid-column-align"+Ie(e,t)+e;break;case 2592:case 3360:return le+Se(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,_e(e.props,/grid-\w+-end/)}))?~ke(e+(n=n[t].value),"span",0)?e:le+Se(e,"-start","")+e+le+"grid-row-span:"+(~ke(n,"span",0)?_e(n,/\d+/):+_e(n,/\d+/)-+_e(e,/\d+/))+";":le+Se(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return _e(e.props,/grid-\w+-start/)}))?e:le+Se(Se(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Se(e,/(.+)-inline(.+)/,pe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ne(e)-1-t>6)switch(xe(e,t+1)){case 109:if(45!==xe(e,t+4))break;case 102:return Se(e,/(.+:)(.+)-([^]+)/,"$1"+pe+"$2-$3$1"+de+(108==xe(e,t+3)?"$3":"$2-$3"))+e;case 115:return~ke(e,"stretch",0)?nt(Se(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Se(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,i,a,s){return le+n+":"+r+s+(o?le+n+"-span:"+(i?a:+a-+r)+s:"")+e}));case 4949:if(121===xe(e,t+6))return Se(e,":",":"+pe)+e;break;case 6444:switch(xe(e,45===xe(e,14)?18:11)){case 120:return Se(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+pe+(45===xe(e,14)?"inline-":"")+"box$3$1"+pe+"$2$3$1"+le+"$2box$3")+e;case 100:return Se(e,":",":"+le)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Se(e,"scroll-","scroll-snap-")+e}return e}function rt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ot(e,t,n,r){switch(e.type){case ye:if(e.children.length)break;case me:case fe:return e.return=e.return||e.value;case he:return"";case ge:return e.return=e.value+"{"+rt(e.children,r)+"}";case ue:if(!Ne(e.value=e.props.join(",")))return""}return Ne(n=rt(e.children,r))?e.return=e.value+"{"+n+"}":""}function it(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case fe:return void(e.return=nt(e.value,e.length,n));case ge:return rt([He(e,{value:Se(e.value,"@","@"+pe)})],r);case ue:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(_e(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":De(He(e,{props:[Se(t,/:(read-\w+)/,":"+de+"$1")]})),De(He(e,{props:[t]})),we(e,{props:Pe(n,r)});break;case"::placeholder":De(He(e,{props:[Se(t,/:(plac\w+)/,":"+pe+"input-$1")]})),De(He(e,{props:[Se(t,/:(plac\w+)/,":"+de+"$1")]})),De(He(e,{props:[Se(t,/:(plac\w+)/,le+"input-$1")]})),De(He(e,{props:[t]})),we(e,{props:Pe(n,r)})}return""}))}}var at={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},st=typeof process<"u"&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ct="active",lt="data-styled-version",dt="6.1.12",pt="/*!sc*/\n",ht=typeof window<"u"&&"HTMLElement"in window,ut=!!("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),ft=/invalid hook call/i,mt=new Set,gt=Object.freeze([]),yt=Object.freeze({});var bt=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),vt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,wt=/(^-|-$)/g;function Ct(e){return e.replace(vt,"-").replace(wt,"")}var _t=/(a)(d)/gi,St=52,kt=function(e){return String.fromCharCode(e+(e>25?39:97))};function xt(e){var t,n="";for(t=Math.abs(e);t>St;t=t/St|0)n=kt(t%St)+n;return(kt(t%St)+n).replace(_t,"$1-$2")}var It,Nt=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ot=function(e){return Nt(5381,e)};function Et(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Pt(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var $t="function"==typeof Symbol&&Symbol.for,Tt=$t?Symbol.for("react.memo"):60115,At=$t?Symbol.for("react.forward_ref"):60112,Rt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Vt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Mt={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},zt=((It={})[At]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},It[Tt]=Mt,It);function Ht(e){return("type"in(t=e)&&t.type.$$typeof)===Tt?Mt:"$$typeof"in e?zt[e.$$typeof]:Rt;var t}var Dt=Object.defineProperty,Lt=Object.getOwnPropertyNames,jt=Object.getOwnPropertySymbols,Ut=Object.getOwnPropertyDescriptor,Ft=Object.getPrototypeOf,Bt=Object.prototype;function qt(e,t,n){if("string"!=typeof t){if(Bt){var r=Ft(t);r&&r!==Bt&&qt(e,r,n)}var o=Lt(t);jt&&(o=o.concat(jt(t)));for(var i=Ht(e),a=Ht(t),s=0;s<o.length;++s){var c=o[s];if(!(c in Vt||n&&n[c]||a&&c in a||i&&c in i)){var l=Ut(t,c);try{Dt(e,c,l)}catch{}}}}return e}function Gt(e){return"function"==typeof e}function Zt(e){return"object"==typeof e&&"styledComponentId"in e}function Wt(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Yt(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function Kt(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Xt(e,t,n){if(void 0===n&&(n=!1),!n&&!Kt(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Xt(e[r],t[r]);else if(Kt(t))for(var r in t)e[r]=Xt(e[r],t[r]);return e}function Jt(e,t){Object.defineProperty(e,"toString",{value:t})}var Qt="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function en(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,i=e.length;o<i;o+=1)r.push(e[o]);return r.forEach((function(e){n=n.replace(/%[a-z]/,e)})),n}function tn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(en.apply(void 0,ie([Qt[e]],t,!1)).trim())}var nn=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw tn(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i<o;i++)this.groupSizes[i]=0}for(var a=this.indexOfGroup(e+1),s=(i=0,t.length);i<s;i++)this.tag.insertRule(a,t[i])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i<o;i++)t+="".concat(this.tag.getRule(i)).concat(pt);return t},e}(),rn=1<<30,on=new Map,an=new Map,sn=1,cn=function(e){if(on.has(e))return on.get(e);for(;an.has(sn);)sn++;var t=sn++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>rn))throw tn(16,"".concat(t));return on.set(e,t),an.set(t,e),t},ln=function(e,t){sn=t+1,on.set(e,t),an.set(t,e)},dn="style[".concat(st,"][").concat(lt,'="').concat(dt,'"]'),pn=new RegExp("^".concat(st,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),hn=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i<a;i++)(r=o[i])&&e.registerName(t,r)},un=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(pt),o=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var c=s.match(pn);if(c){var l=0|parseInt(c[1],10),d=c[2];0!==l&&(ln(d,l),hn(e,d,c[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(s)}}},fn=function(e){for(var t=document.querySelectorAll(dn),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(st)!==ct&&(un(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var mn=function(e){var t,n,r=document.head,o=e||r,i=document.createElement("style"),a=(t=o,(n=Array.from(t.querySelectorAll("style[".concat(st,"]"))))[n.length-1]),s=void 0!==a?a.nextSibling:null;i.setAttribute(st,ct),i.setAttribute(lt,dt);var c=typeof __webpack_nonce__<"u"?__webpack_nonce__:null;return c&&i.setAttribute("nonce",c),o.insertBefore(i,s),i},gn=function(){function e(e){this.element=mn(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw tn(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),yn=function(){function e(e){this.element=mn(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),bn=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),vn=ht,wn={isServer:!ht,useCSSOMInjection:!ut},Cn=function(){function e(e,t,n){void 0===e&&(e=yt),void 0===t&&(t={});var r=this;this.options=oe(oe({},wn),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&ht&&vn&&(vn=!1,fn(this)),Jt(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o,i=(o=n,an.get(o));if(void 0===i)return"continue";var a=e.names.get(i),s=t.getGroup(n);if(void 0===a||!a.size||0===s.length)return"continue";var c="".concat(st,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==a&&a.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(s).concat(c,'{content:"').concat(l,'"}').concat(pt)},i=0;i<n;i++)o(i);return r}(r)}))}return e.registerId=function(e){return cn(e)},e.prototype.rehydrate=function(){!this.server&&ht&&fn(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(oe(oe({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=this.options,t=e.useCSSOMInjection,n=e.target,r=e.isServer?new bn(n):t?new gn(n):new yn(n),new nn(r)));var e,t,n,r},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(cn(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(cn(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(cn(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),_n=/&/g,Sn=/^\s*\/\/.*$/gm;function kn(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=kn(e.children,t)),e}))}var xn=new Cn,In=function(){var e,t,n,r=yt,o=r.options,i=void 0===o?yt:o,a=r.plugins,s=void 0===a?gt:a,c=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},l=s.slice();l.push((function(e){e.type===ue&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(_n,t).replace(n,c))})),i.prefix&&l.push(it),l.push(ot);var d=function(r,o,a,s){void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s="&"),e=s,t=o,n=new RegExp("\\".concat(t,"\\b"),"g");var c=r.replace(Sn,""),d=Xe(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);i.namespace&&(d=kn(d,i.namespace));var p,h,u,f=[];return rt(d,(p=l.concat((u=function(e){return f.push(e)},function(e){e.root||(e=e.return)&&u(e)})),h=Oe(p),function(e,t,n,r){for(var o="",i=0;i<h;i++)o+=p[i](e,t,n,r)||"";return o})),f};return d.hash=s.length?s.reduce((function(e,t){return t.name||tn(15),Nt(e,t.name)}),5381).toString():"",d}(),Nn=N.createContext({shouldForwardProp:void 0,styleSheet:xn,stylis:In});function On(){return $(Nn)}N.createContext(void 0);var En=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=In);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Jt(this,(function(){throw tn(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=In),this.name+e.hash},e}(),Pn=function(e){return e>="A"&&e<="Z"};function $n(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Pn(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Tn=function(e){return null==e||!1===e||""===e},An=function(e){var t,n,r=[];for(var o in e){var i=e[o];e.hasOwnProperty(o)&&!Tn(i)&&(Array.isArray(i)&&i.isCss||Gt(i)?r.push("".concat($n(o),":"),i,";"):Kt(i)?r.push.apply(r,ie(ie(["".concat(o," {")],An(i),!1),["}"],!1)):r.push("".concat($n(o),": ").concat((t=o,null==(n=i)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in at||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Rn(e,t,n,r){if(Tn(e))return[];if(Zt(e))return[".".concat(e.styledComponentId)];if(Gt(e)){if(!Gt(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof En||Kt(o)||null===o||console.error("".concat(Et(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Rn(o,t,n,r)}var i;return e instanceof En?n?(e.inject(n,r),[e.getName(r)]):[e]:Kt(e)?An(e):Array.isArray(e)?Array.prototype.concat.apply(gt,e.map((function(e){return Rn(e,t,n,r)}))):[e.toString()]}var Vn=Ot(dt),Mn=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Gt(n)&&!Zt(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Nt(Vn,t),this.baseStyle=n,Cn.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=Wt(r,this.staticRulesId);else{var o=Yt(Rn(this.rules,e,t,n)),i=xt(Nt(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,i)){var a=n(o,".".concat(i),void 0,this.componentId);t.insertRules(this.componentId,i,a)}r=Wt(r,i),this.staticRulesId=i}else{for(var s=Nt(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var d=this.rules[l];if("string"==typeof d)c+=d,"production"!==process.env.NODE_ENV&&(s=Nt(s,d));else if(d){var p=Yt(Rn(d,e,t,n));s=Nt(s,p+l),c+=p}}if(c){var h=xt(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(c,".".concat(h),void 0,this.componentId)),r=Wt(r,h)}}return r},e}(),zn=N.createContext(void 0),Hn={},Dn=new Set;function Ln(e,t,n){var r,o=Zt(e),i=e,a=!Pt(e),s=t.attrs,c=void 0===s?gt:s,l=t.componentId,d=void 0===l?function(e,t){var n="string"!=typeof e?"sc":Ct(e);Hn[n]=(Hn[n]||0)+1;var r="".concat(n,"-").concat(function(e){return xt(Ot(e)>>>0)}(dt+n+Hn[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):l,p=t.displayName,h=void 0===p?Pt(r=e)?"styled.".concat(r):"Styled(".concat(Et(r),")"):p,u=t.displayName&&t.componentId?"".concat(Ct(t.displayName),"-").concat(t.componentId):t.componentId||d,f=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,m=t.shouldForwardProp;if(o&&i.shouldForwardProp){var g=i.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;m=function(e,t){return g(e,t)&&y(e,t)}}else m=g}var b=new Mn(n,u,o?i.componentStyle:void 0);function v(e,t){return function(e,t,n){var r=e.attrs,o=e.componentStyle,i=e.defaultProps,a=e.foldedComponentIds,s=e.styledComponentId,c=e.target,l=N.useContext(zn),d=On(),p=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&E(s);var h=function(e,t,n){return void 0===n&&(n=yt),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,i)||yt,u=function(e,t,n){for(var r,o=oe(oe({},t),{className:void 0,theme:n}),i=0;i<e.length;i+=1){var a=Gt(r=e[i])?r(o):r;for(var s in a)o[s]="className"===s?Wt(o[s],a[s]):"style"===s?oe(oe({},o[s]),a[s]):a[s]}return t.className&&(o.className=Wt(o.className,t.className)),o}(r,t,h),f=u.as||c,m={};for(var g in u)void 0===u[g]||"$"===g[0]||"as"===g||"theme"===g&&u.theme===h||("forwardedAs"===g?m.as=u.forwardedAs:p&&!p(g,f)||(m[g]=u[g],p||"development"!==process.env.NODE_ENV||ce(g)||Dn.has(g)||!bt.has(f)||(Dn.add(g),console.warn('styled-components: it looks like an unknown prop "'.concat(g,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var y,b,v,w,C=(y=o,b=u,v=On(),w=y.generateAndInjectStyles(b,v.styleSheet,v.stylis),"production"!==process.env.NODE_ENV&&E(w),w);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(C);var _=Wt(a,s);return C&&(_+=" "+C),u.className&&(_+=" "+u.className),m[Pt(f)&&!bt.has(f)?"class":"className"]=_,m.ref=n,P(f,m)}(w,e,t)}v.displayName=h;var w=N.forwardRef(v);return w.attrs=f,w.componentStyle=b,w.displayName=h,w.shouldForwardProp=m,w.foldedComponentIds=o?Wt(i.foldedComponentIds,i.styledComponentId):"",w.styledComponentId=u,w.target=o?i.target:e,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=o?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Xt(e,o[r],!0);return e}({},i.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(function(e,t){if("production"!==process.env.NODE_ENV){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",o=console.error;try{var i=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ft.test(e)?(i=!1,mt.delete(r)):o.apply(void 0,ie([e],t,!1))},O(),i&&!mt.has(r)&&(console.warn(r),mt.add(r))}catch(e){ft.test(e.message)&&mt.delete(r)}finally{console.error=o}}}(h,u),w.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var i=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(i,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(h,u)),Jt(w,(function(){return".".concat(w.styledComponentId)})),a&&qt(w,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function jn(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var Un=function(e){return Object.assign(e,{isCss:!0})};function Fn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Gt(e)||Kt(e))return Un(Rn(jn(gt,ie([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Rn(r):Un(Rn(jn(r,t)))}function Bn(e,t,n){if(void 0===n&&(n=yt),!t)throw tn(1,t);var r=function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];return e(t,n,Fn.apply(void 0,ie([r],o,!1)))};return r.attrs=function(r){return Bn(e,t,oe(oe({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Bn(e,t,oe(oe({},n),r))},r}var qn=function(e){return Bn(Ln,e)},Gn=qn;bt.forEach((function(e){Gn[e]=qn(e)})),"production"!==process.env.NODE_ENV&&typeof navigator<"u"&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var Zn="__sc-".concat(st,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&typeof window<"u"&&(window[Zn]||(window[Zn]=0),1===window[Zn]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[Zn]+=1);const Wn=Gn.details`
2
2
  summary {
3
3
  cursor: pointer;
4
4
  }
@@ -9,27 +9,27 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
9
9
  padding-right: 0.25rem;
10
10
  }
11
11
  }
12
- `,Zn=Bn.div`
12
+ `,Yn=Gn.div`
13
13
  margin-top: 2rem;
14
- `,Wn=Bn.ul`
14
+ `,Kn=Gn.ul`
15
15
  list-style: none;
16
16
  padding-left: 0;
17
17
  margin-block-start: 0;
18
18
  li svg.info {
19
19
  height: 1.2rem;
20
20
  width: 1.2rem;
21
- color: ${R.gray[800].hex};
21
+ color: ${z.gray[800].hex};
22
22
  border-radius: 3px;
23
23
  transition: all 0.1s ease-in-out;
24
24
  &.warning:hover {
25
- color: ${R.gray[100].hex};
26
- background-color: ${R.yellow[500].hex};
25
+ color: ${z.gray[100].hex};
26
+ background-color: ${z.yellow[500].hex};
27
27
  }
28
28
  &.error {
29
- color: ${R.red[500].hex};
29
+ color: ${z.red[500].hex};
30
30
  &:hover {
31
- color: ${R.gray[100].hex};
32
- background-color: ${R.red[500].hex};
31
+ color: ${z.gray[100].hex};
32
+ background-color: ${z.red[500].hex};
33
33
  }
34
34
  }
35
35
  }
@@ -38,7 +38,7 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
38
38
  width: 1.5rem;
39
39
  visibility: hidden;
40
40
  }
41
- `,Yn=Bn.button`
41
+ `,Xn=Gn.button`
42
42
  background: none;
43
43
  border: none;
44
44
  padding: 0.5rem;
@@ -48,21 +48,22 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
48
48
  padding-right: 0.25rem;
49
49
  }
50
50
  &:hover {
51
- background-color: ${R.gray[50].hex};
51
+ background-color: ${z.gray[50].hex};
52
52
  }
53
53
  &.add:hover {
54
- background-color: ${R.green[500].hex};
55
- span {
54
+ background-color: ${z.green[500].hex};
55
+ span,
56
+ svg {
56
57
  color: white;
57
58
  }
58
59
  }
59
- `,Kn=Bn.button`
60
+ `,Jn=Gn.button`
60
61
  background: none;
61
62
  border: none;
62
63
  padding: 0.2rem 0 0;
63
64
  cursor: pointer;
64
65
  svg {
65
- color: ${R.gray[800].hex};
66
+ color: ${z.gray[800].hex};
66
67
  border-radius: 3px;
67
68
  transition: all 0.1s ease-in-out;
68
69
  }
@@ -75,19 +76,19 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
75
76
  height: 1.2rem;
76
77
  width: 1.2rem;
77
78
  &:hover {
78
- color: ${R.gray[100].hex};
79
+ color: ${z.gray[100].hex};
79
80
  }
80
81
  &.info:hover {
81
- background-color: ${R.blue[500].hex};
82
+ background-color: ${z.blue[500].hex};
82
83
  }
83
84
  &.add:hover {
84
- background-color: ${R.green[500].hex};
85
+ background-color: ${z.green[500].hex};
85
86
  }
86
87
  &.remove:hover {
87
- background-color: ${R.red[500].hex};
88
+ background-color: ${z.red[500].hex};
88
89
  }
89
90
  }
90
- `,Xn=Bn.button`
91
+ `,Qn=Gn.button`
91
92
  background: none;
92
93
  border: none;
93
94
  padding: 0.2rem 0 0;
@@ -96,11 +97,11 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
96
97
  height: 1.5rem;
97
98
  width: 1.5rem;
98
99
  }
99
- `,Jn=Bn.li`
100
+ `,er=Gn.li`
100
101
  font-weight: bold;
101
102
  margin-top: 1rem;
102
103
  .untitled {
103
- color: ${R.gray[400].hex};
104
+ color: ${z.gray[400].hex};
104
105
  font-weight: normal;
105
106
  }
106
107
  button[aria-expanded='true'] svg {
@@ -109,12 +110,12 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
109
110
  &.closed ul {
110
111
  display: none;
111
112
  }
112
- `,Qn=Bn.li`
113
+ `,tr=Gn.li`
113
114
  padding-top: 0.5rem;
114
115
  font-weight: normal;
115
116
  margin-top: 1rem;
116
117
  .untitled {
117
- color: ${R.gray[400].hex};
118
+ color: ${z.gray[400].hex};
118
119
  }
119
120
  button[aria-expanded='true'] svg {
120
121
  rotate: 90deg;
@@ -122,9 +123,9 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
122
123
  &.closed ul {
123
124
  display: none;
124
125
  }
125
- `,er=Bn.ul`
126
+ `,nr=Gn.ul`
126
127
  list-style: none;
127
- `,tr=Bn.li`
128
+ `,rr=Gn.li`
128
129
  font-weight: normal;
129
130
  margin-top: 1rem;
130
131
  button[aria-expanded='true'] svg {
@@ -133,12 +134,12 @@ import{useFormValue as e,set as t,useDocumentStore as n,useClient as r,defineFie
133
134
  &.closed ul {
134
135
  display: none;
135
136
  }
136
- `,nr=Bn.a`
137
- color: ${R.gray[800].hex};
137
+ `,or=Gn.a`
138
+ color: ${z.gray[800].hex};
138
139
  text-decoration: none;
139
140
  &:hover {
140
141
  text-decoration: underline;
141
142
  }
142
- `,rr=Bn.p`
143
- color: ${R.gray[800].hex};
144
- `;const or=e=>{const{onChange:n}=e,r=H(),o=E((()=>{n(t(_(6))),r.push({status:"success",title:"Identifier created.",closable:!0})}),[n,r]);return p(M,{space:2,children:p(L,{space:[3,3,4],children:p(D,{tone:"primary",fontSize:2,onClick:o,text:"Generate Identifier"})})})};var ir=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ar={},sr={},cr={};Object.defineProperty(cr,"__esModule",{value:!0});var lr="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";cr.default=function(e){var t=e.split("-"),n=t[1],r=t[2],o=t[3];if(!n||!r||!o)throw new Error("Malformed asset _ref '".concat(e,"'. Expected an id like \"").concat(lr,'".'));var i=r.split("x"),a=+i[0],s=+i[1];if(!(isFinite(a)&&isFinite(s)))throw new Error("Malformed asset _ref '".concat(e,"'. Expected an id like \"").concat(lr,'".'));return{id:n,width:a,height:s,format:o}};var dr={},pr=ir&&ir.__assign||function(){return pr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pr.apply(this,arguments)};Object.defineProperty(dr,"__esModule",{value:!0});function hr(e){var t=e.split("/").slice(-1);return"image-".concat(t[0]).replace(/\.([a-z]+)$/,"-$1")}dr.default=function(e){if(!e)return null;var t,n;if("string"==typeof e&&/^https?:\/\//.test("".concat(e)))t={asset:{_ref:hr(e)}};else if("string"==typeof e)t={asset:{_ref:e}};else if((n=e)&&"string"==typeof n._ref)t={asset:e};else if(function(e){return!!e&&"string"==typeof e._id}(e))t={asset:{_ref:e._id||""}};else if(function(e){var t=e;return!(!t||!t.asset)&&"string"==typeof t.asset.url}(e))t={asset:{_ref:hr(e.asset.url)}};else{if("object"!=typeof e.asset)return null;t=pr({},e)}var r=e;return r.crop&&(t.crop=r.crop),r.hotspot&&(t.hotspot=r.hotspot),function(e){if(e.crop&&e.hotspot)return e;var t=pr({},e);return t.crop||(t.crop={left:0,top:0,bottom:0,right:0}),t.hotspot||(t.hotspot={x:.5,y:.5,height:1,width:1}),t}(t)},function(e){var t=ir&&ir.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)},n=ir&&ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseSource=e.SPEC_NAME_TO_URL_NAME_MAPPINGS=void 0;var r=n(cr),o=n(dr);e.parseSource=o.default,e.SPEC_NAME_TO_URL_NAME_MAPPINGS=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"]],e.default=function(n){var i=t({},n||{}),a=i.source;delete i.source;var s=(0,o.default)(a);if(!s)throw new Error("Unable to resolve image URL from source (".concat(JSON.stringify(a),")"));var c=s.asset._ref||s.asset._id||"",l=(0,r.default)(c),d=Math.round(s.crop.left*l.width),p=Math.round(s.crop.top*l.height),h={left:d,top:p,width:Math.round(l.width-s.crop.right*l.width-d),height:Math.round(l.height-s.crop.bottom*l.height-p)},u=s.hotspot.height*l.height/2,f=s.hotspot.width*l.width/2,m=s.hotspot.x*l.width,g=s.hotspot.y*l.height,y={left:m-f,top:g-u,right:m+f,bottom:g+u};return i.rect||i.focalPoint||i.ignoreImageParams||i.crop||(i=t(t({},i),function(e,t){var n,r=t.width,o=t.height;if(!r||!o)return{width:r,height:o,rect:e.crop};var i=e.crop,a=e.hotspot,s=r/o,c=i.width/i.height;if(c>s){var l=Math.round(i.height),d=Math.round(l*s),p=Math.max(0,Math.round(i.top)),h=Math.round((a.right-a.left)/2+a.left);(u=Math.max(0,Math.round(h-d/2)))<i.left?u=i.left:u+d>i.left+i.width&&(u=i.left+i.width-d),n={left:u,top:p,width:d,height:l}}else{d=i.width,l=Math.round(d/s);var u=Math.max(0,Math.round(i.left)),f=Math.round((a.bottom-a.top)/2+a.top),m=Math.max(0,Math.round(f-l/2));m<i.top?m=i.top:m+l>i.top+i.height&&(m=i.top+i.height-l),n={left:u,top:m,width:d,height:l}}return{width:r,height:o,rect:n}}({crop:h,hotspot:y},i))),function(t){var n=(t.baseUrl||"https://cdn.sanity.io").replace(/\/+$/,""),r="".concat(t.asset.id,"-").concat(t.asset.width,"x").concat(t.asset.height,".").concat(t.asset.format),o="".concat(n,"/images/").concat(t.projectId,"/").concat(t.dataset,"/").concat(r),i=[];if(t.rect){var a=t.rect,s=a.left,c=a.top,l=a.width,d=a.height;(0!==s||0!==c||d!==t.asset.height||l!==t.asset.width)&&i.push("rect=".concat(s,",").concat(c,",").concat(l,",").concat(d))}t.bg&&i.push("bg=".concat(t.bg)),t.focalPoint&&(i.push("fp-x=".concat(t.focalPoint.x)),i.push("fp-y=".concat(t.focalPoint.y)));var p=[t.flipHorizontal&&"h",t.flipVertical&&"v"].filter(Boolean).join("");return p&&i.push("flip=".concat(p)),e.SPEC_NAME_TO_URL_NAME_MAPPINGS.forEach((function(e){var n=e[0],r=e[1];typeof t[n]<"u"?i.push("".concat(r,"=").concat(encodeURIComponent(t[n]))):typeof t[r]<"u"&&i.push("".concat(r,"=").concat(encodeURIComponent(t[r])))})),0===i.length?o:"".concat(o,"?").concat(i.join("&"))}(t(t({},i),{asset:l}))}}(sr);var ur=ir&&ir.__assign||function(){return ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ur.apply(this,arguments)},fr=ir&&ir.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),mr=ir&&ir.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gr=ir&&ir.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&fr(t,e,n);return mr(t,e),t};Object.defineProperty(ar,"__esModule",{value:!0}),ar.ImageUrlBuilder=void 0;var yr=gr(sr),br=["clip","crop","fill","fillmax","max","scale","min"],vr=["top","bottom","left","right","center","focalpoint","entropy"],wr=["format"];function Cr(e){for(var t=0,n=yr.SPEC_NAME_TO_URL_NAME_MAPPINGS;t<n.length;t++){var r=n[t],o=r[0],i=r[1];if(e===o||e===i)return o}return e}ar.default=function(e){if(function(e){return!(!e||!("config"in e))&&"function"==typeof e.config}(e)){var t=e.config(),n=t.apiHost,r=t.projectId,o=t.dataset;return new _r(null,{baseUrl:(n||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:r,dataset:o})}var i=e;if(function(e){return!(!e||!("clientConfig"in e))&&"object"==typeof e.clientConfig}(i)){var a=i.clientConfig;n=a.apiHost,r=a.projectId,o=a.dataset;return new _r(null,{baseUrl:(n||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:r,dataset:o})}return new _r(null,e)};var _r=function(){function e(e,t){this.options=ur(e?ur({},e.options||{}):{},t||{})}return e.prototype.withOptions=function(t){var n=t.baseUrl||this.options.baseUrl,r={baseUrl:n};for(var o in t)if(t.hasOwnProperty(o)){r[Cr(o)]=t[o]}return new e(this,ur({baseUrl:n},r))},e.prototype.image=function(e){return this.withOptions({source:e})},e.prototype.dataset=function(e){return this.withOptions({dataset:e})},e.prototype.projectId=function(e){return this.withOptions({projectId:e})},e.prototype.bg=function(e){return this.withOptions({bg:e})},e.prototype.dpr=function(e){return this.withOptions(e&&1!==e?{dpr:e}:{})},e.prototype.width=function(e){return this.withOptions({width:e})},e.prototype.height=function(e){return this.withOptions({height:e})},e.prototype.focalPoint=function(e,t){return this.withOptions({focalPoint:{x:e,y:t}})},e.prototype.maxWidth=function(e){return this.withOptions({maxWidth:e})},e.prototype.minWidth=function(e){return this.withOptions({minWidth:e})},e.prototype.maxHeight=function(e){return this.withOptions({maxHeight:e})},e.prototype.minHeight=function(e){return this.withOptions({minHeight:e})},e.prototype.size=function(e,t){return this.withOptions({width:e,height:t})},e.prototype.blur=function(e){return this.withOptions({blur:e})},e.prototype.sharpen=function(e){return this.withOptions({sharpen:e})},e.prototype.rect=function(e,t,n,r){return this.withOptions({rect:{left:e,top:t,width:n,height:r}})},e.prototype.format=function(e){return this.withOptions({format:e})},e.prototype.invert=function(e){return this.withOptions({invert:e})},e.prototype.orientation=function(e){return this.withOptions({orientation:e})},e.prototype.quality=function(e){return this.withOptions({quality:e})},e.prototype.forceDownload=function(e){return this.withOptions({download:e})},e.prototype.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},e.prototype.flipVertical=function(){return this.withOptions({flipVertical:!0})},e.prototype.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},e.prototype.fit=function(e){if(-1===br.indexOf(e))throw new Error('Invalid fit mode "'.concat(e,'"'));return this.withOptions({fit:e})},e.prototype.crop=function(e){if(-1===vr.indexOf(e))throw new Error('Invalid crop mode "'.concat(e,'"'));return this.withOptions({crop:e})},e.prototype.saturation=function(e){return this.withOptions({saturation:e})},e.prototype.auto=function(e){if(-1===wr.indexOf(e))throw new Error('Invalid auto mode "'.concat(e,'"'));return this.withOptions({auto:e})},e.prototype.pad=function(e){return this.withOptions({pad:e})},e.prototype.url=function(){return(0,yr.default)(this.options)},e.prototype.toString=function(){return this.url()},e}();ar.ImageUrlBuilder=_r,(ir&&ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ar);const Sr={},kr={apiVersion:"v2023-05-01"},xr=null;function Ir(e){const t=A((()=>JSON.stringify(e||{})),[e]);return A((()=>JSON.parse(t)),[t])}function Nr(e,t){let{params:r=Sr,options:o=kr,initialValue:i=xr}=t;const[a,s]=$(!0),[c,l]=$(!1),[d,p]=$(i),h=Ir(r),u=Ir(o),f=I(null),m=n();return T((()=>{if(e&&!c&&!f.current)try{f.current=m.listenQuery(e,h,u).pipe(Q(J),ee((e=>(console.error(e),l(e),s(!1),p(null),e)))).subscribe((e=>{p((t=>J(t,e)?t:e)),s(!1),l(!1)}))}catch(e){console.error(e),s(!1),l(e)}return c&&f.current&&f.current.unsubscribe(),()=>{var e;f.current&&(null==(e=f?.current)||e.unsubscribe(),f.current=null)}}),[e,c,h,u,m]),{data:d,loading:a,error:c}}var Or,Pr,Er,$r=Object.freeze,Tr=Object.defineProperty,Ar=(e,t)=>$r(Tr(e,"raw",{value:$r(e.slice())}));Bn((function(){return p(j,{as:"table",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})}))((()=>jn(Or||(Or=Ar(["\n display: table;\n width: 100%;\n border-collapse: collapse;\n\n &:not([hidden]) {\n display: table;\n border-collapse: collapse;\n }\n "])))));Bn((function(){return p(j,{as:"tr",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})}))((()=>jn(Pr||(Pr=Ar(["\n display: table-row;\n\n &:not([hidden]) {\n display: table-row;\n }\n "])))));Bn((function(){return p(j,{as:"td",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})}))((()=>jn(Er||(Er=Ar(["\n display: table-cell;\n\n &:not([hidden]) {\n display: table-cell;\n }\n "])))));const Vr=(e=1)=>e>6?"":`"childConcepts": *[\n (_id in $draftConceptIds ||\n (\n _id in $conceptIds &&\n !(conceptId in $draftConceptIds)\n )\n ) && ^._id in broader[]._ref ]|order(prefLabel){\n "id": _id,\n "level": ${e},\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Vr(e+1)}\n }`,Rr=(e=1)=>e>6?"":`"childConcepts": *[_id in *[_id == $id][0].concepts[]._ref && ^._id in broader[]._ref ]|order(prefLabel){\n "id": _id,\n "level": ${e},\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Rr(e+1)}\n }`,Mr=V(null),zr=V({editControls:!1});function Hr(e){const t=H(),n=r({apiVersion:"2021-10-21"}),o=function(){const e=P(te),{routerPanesState:t,groupIndex:n}=c();return E((r=>{if(!e||!r)return;const o=[...t];o.splice(n+1,n+1,[{id:r,params:{type:"skosConcept"}}]);const i=e.resolvePathFromState({panes:o});e.navigateUrl({path:i})}),[e,t,n])}(),i=e.displayed.baseIri;return E(((r,a,s)=>{let c;c=a?{_id:`drafts.${_()}`,_type:"skosConcept",conceptId:`${_(6)}`,prefLabel:"",baseIri:i,broader:[a&&{_key:_(6),_ref:a,_type:"reference"}],related:[]}:{_id:`drafts.${_()}`,_type:"skosConcept",conceptId:`${_(6)}`,prefLabel:"",baseIri:i,broader:[],related:[]};const l=JSON.parse(JSON.stringify(e.displayed));l._id.includes("drafts.")||(l._id=`drafts.${l._id}`),n.transaction().createIfNotExists(l).create(c).patch(l._id,(e=>"topConcept"==r?e.setIfMissing({topConcepts:[]}).append("topConcepts",[{_ref:c._id.replace("drafts.",""),_type:"reference",_key:_(6),_weak:!0,_strengthenOnPublish:{_type:"skosConcept",weak:!0,template:{id:"skosConcept",params:"undefined"}}}]):e.setIfMissing({concepts:[]}).insert("after","concepts[-1]",[{_ref:c._id.replace("drafts.",""),_type:"reference",_key:_(6),_weak:!0,_strengthenOnPublish:{_type:"skosConcept",weak:void 0,template:{id:"skosConcept",params:"undefined"}}}]))).commit({autoGenerateArrayKeys:!0}).then((e=>{t.push({closable:!0,status:"success",title:"Created new concept"}),o(c._id)})).catch((e=>{t.push({closable:!0,status:"error",title:"Error creating concept",description:e.message})}))}),[e.displayed,n,i,t,o])}function Lr(e){const t=H(),n=r({apiVersion:"2021-10-21"});return E(((r,o,i)=>{const a="topConcept"==o?"topConcepts":"concepts",s=JSON.parse(JSON.stringify(e.displayed));s._id.includes("drafts.")||(s._id=`drafts.${s._id}`),n.transaction().createIfNotExists(s).patch(s._id,(e=>e.unset([`${a}[_ref=="${r.replace("drafts.","")}"]`]))).commit().then((e=>{t.push({closable:!0,status:"success",title:(i?`"${i}"`:"Concept")+" removed from scheme"})})).catch((e=>{t.push({closable:!0,status:"error",title:"Error removing concept",description:e.message})}))}),[n,e.displayed,t])}function Dr({concept:e}){const t=P(te),{routerPanesState:n,groupIndex:r}=c(),{id:o,prefLabel:i}=e??{},a=E((()=>{if(!t||!o)return;const e=[...n];e.splice(r+1,r+1,[{id:o,params:{type:"skosConcept"}}]);const i=t.resolvePathFromState({panes:e});t.navigateUrl({path:i})}),[o,t,n,r]);return p(nr,{href:"#",onClick:a,children:i})}const jr=({concept:e})=>{const[t,n]=$(!1),r=E((()=>n(!1)),[]),o=E((()=>n(!0)),[]);return e&&(e.definition||e.example||e.scopeNote)?d(h,{children:[p(Kn,{className:"action","aria-label":"info",onClick:o,type:"button",children:p(u,{className:"info"})}),t&&p(U,{header:e.prefLabel,id:"dialog-example",onClose:r,zOffset:1e3,width:1,children:p(F,{padding:4,paddingBottom:5,children:d(M,{space:4,children:[e.definition&&d(M,{space:2,children:[p(B,{size:1,children:"Definition"}),p(z,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.definition})]}),e.example&&d(M,{space:2,children:[p(B,{size:1,children:"Example"}),p(z,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.example})]}),e.scopeNote&&d(M,{space:2,children:[p(B,{size:1,children:"Scope Note"}),p(z,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.scopeNote})]})]})})})]}):null};function Ur({concept:e,selectConcept:t}){const{prefLabel:n,id:r}=e??{},o=E((()=>{t({_ref:r,_type:"reference"})}),[r,t]);return p(h,{children:t?p(nr,{href:"#",onClick:o,children:n}):p(rr,{children:n})})}const Fr=({concept:e,selectConcept:t,inputComponent:n=!1})=>{const r=P(Mr)||{},{globalVisibility:{treeVisibility:o}}=P(zr)||{},{editControls:i}=P(zr)||{editControls:!1},a=Hr(r),s=Lr(r),c=E((()=>{a("concept",e?.id,e?.prefLabel)}),[e?.id,e?.prefLabel,a]),l=E((()=>{s(e.id,"concept",e?.prefLabel)}),[e.id,e?.prefLabel,s]),[h,v]=$(o),w=E((()=>{"open"==h?v("closed"):"closed"==h&&v("open")}),[h]);return d(tr,{className:h,children:[d(L,{space:2,children:[d(L,{space:1,children:[d(L,{space:1,children:[e?.childConcepts&&e.childConcepts.length>0&&p(Xn,{onClick:w,type:"button","aria-expanded":"open"==h,children:p(f,{})}),e?.childConcepts&&0==e.childConcepts.length&&p(m,{className:"spacer"}),!e?.prefLabel&&p("span",{className:"untitled",children:"[new concept]"}),n?p(Ur,{concept:e,selectConcept:t}):p(Dr,{concept:e})]}),!i&&p(jr,{concept:e})]}),i&&e?.level&&e.level<5&&d(L,{space:2,children:[p(Kn,{onClick:c,type:"button",className:"action","aria-label":"Add child a child concept",children:p(g,{className:"add"})}),p(Kn,{onClick:l,type:"button",className:"action","aria-label":"Remove concept from scheme",children:p(y,{className:"remove"})})]}),i&&0==e.childConcepts?.length&&5==e.level&&d(L,{space:2,children:[p(q,{content:p(F,{padding:2,sizing:"border",children:p(M,{padding:1,space:2,children:p(z,{muted:!0,size:1,children:"This concept is at the maximum Taxonomy Manager hierarchy depth of 5 levels."})})}),fallbackPlacements:["right","left"],placement:"top",children:p(u,{className:"info warning"})}),p(Kn,{onClick:l,type:"button",className:"action","aria-label":"Remove concept from scheme",children:p(y,{className:"remove"})})]}),e?.childConcepts&&e?.childConcepts?.length>0&&5==e.level&&d(L,{space:1,children:[p(q,{content:p(F,{padding:2,sizing:"border",children:d(M,{padding:1,space:2,children:[p(z,{muted:!0,size:1,children:"This concept has unlisted child concepts."}),p(z,{muted:!0,size:1,children:"The maximum hierarchy depth is 5 levels."})]})}),fallbackPlacements:["right","left"],placement:"top",children:p(b,{className:"info error"})}),r.displayed?.controls&&p(Kn,{onClick:l,type:"button",className:"action","aria-label":"Remove concept from scheme",children:p(y,{className:"remove"})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&e?.level&&e.level<5&&p(Br,{concepts:e.childConcepts,selectConcept:t,inputComponent:n})]})},Br=({concepts:e,inputComponent:t=!1,selectConcept:n})=>p(er,{children:e.map((e=>p(Fr,{concept:e,selectConcept:n,inputComponent:t},e.id)))}),qr=({concept:e,treeVisibility:t,inputComponent:n,selectConcept:r})=>{const o=P(Mr)||{},{editControls:i}=P(zr)||{editControls:!1},a=Hr(o),s=Lr(o),[c,l]=$(t),h=E((()=>{"open"==c?l("closed"):"closed"==c&&l("open")}),[c]),u=E((()=>{a("concept",e?.id,e?.prefLabel)}),[e?.id,e?.prefLabel,a]),b=E((()=>{s(e?.id,"topConcept",e?.prefLabel)}),[e?.id,e?.prefLabel,s]);return d(Jn,{className:c,children:[d(L,{space:2,children:[d(L,{space:0,children:[e?.childConcepts&&e.childConcepts.length>0&&p(Xn,{onClick:h,type:"button","aria-expanded":"open"==c,children:p(f,{})}),e?.childConcepts&&0==e.childConcepts.length&&p(m,{className:"spacer"}),!e?.prefLabel&&p("span",{className:"untitled",children:"[new concept]"}),n?p(Ur,{concept:e,selectConcept:r}):p(Dr,{concept:e})]}),p(z,{size:1,muted:!0,children:"top concept"}),!i&&p(jr,{concept:e}),i&&d(L,{space:2,children:[p(q,{content:p(F,{padding:2,sizing:"border",children:p(M,{padding:1,space:2,children:p(z,{muted:!0,size:1,children:"Add a child concept"})})}),fallbackPlacements:["right","left"],placement:"top",children:p(Kn,{onClick:u,type:"button",className:"action","aria-label":"Add child a child concept",children:p(g,{className:"add"})})}),p(q,{content:p(F,{padding:2,sizing:"border",children:p(M,{padding:1,space:2,children:p(z,{muted:!0,size:1,children:"Remove concept from scheme"})})}),fallbackPlacements:["right","left"],placement:"top",children:p(Kn,{onClick:b,type:"button",className:"action","aria-label":"Remove concept from scheme",children:p(y,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&p(Br,{concepts:e.childConcepts,selectConcept:r,inputComponent:n})]})},Gr=({concept:e,treeVisibility:t,inputComponent:n,selectConcept:r})=>{const o=P(Mr)||{},{editControls:i}=P(zr)||{editControls:!1},a=Hr(o),s=Lr(o),[c,l]=$(t),h=E((()=>{"open"==c?l("closed"):"closed"==c&&l("open")}),[c]),u=E((()=>{a("concept",e?.id,e?.prefLabel)}),[e?.id,e?.prefLabel,a]),b=E((()=>{s(e.id,"concept",e?.prefLabel)}),[e.id,e?.prefLabel,s]);return d(Qn,{className:c,children:[d(L,{space:2,children:[e?.childConcepts&&e.childConcepts.length>0&&(n?p(m,{className:"spacer"}):p(Xn,{onClick:h,type:"button","aria-expanded":"open"==c,children:p(f,{})})),e?.childConcepts&&0==e.childConcepts.length&&p(m,{className:"spacer"}),!e?.prefLabel&&p("span",{className:"untitled",children:"[new concept]"}),n?p(Ur,{concept:e,selectConcept:r}):p(Dr,{concept:e}),o.displayed?.topConcepts?.length>0&&p(z,{size:1,muted:!0,children:"orphan"}),!i&&p(jr,{concept:e}),!n&&i&&d(L,{space:2,children:[p(q,{content:p(F,{padding:2,sizing:"border",children:p(M,{padding:1,space:2,children:p(z,{muted:!0,size:1,children:"Add a child concept"})})}),fallbackPlacements:["right","left"],placement:"top",children:p(Kn,{onClick:u,type:"button",className:"action","aria-label":"Add child a child concept",children:p(g,{className:"add"})})}),p(q,{content:p(F,{padding:2,sizing:"border",children:p(M,{padding:1,space:2,children:p(z,{muted:!0,size:1,children:"Remove concept from scheme"})})}),fallbackPlacements:["right","left"],placement:"top",children:p(Kn,{onClick:b,type:"button",className:"action","aria-label":"Remove concept from scheme",children:p(y,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&p(Br,{concepts:e.childConcepts,selectConcept:r,inputComponent:n})]})},Zr=({document:e})=>{const[t,n]=$(!1),[o,i]=$(""),[a,s]=$(""),c=E((()=>n(!1)),[]),l=E((()=>n(!0)),[]),h=E((e=>{i(e.currentTarget.value)}),[]),u=E((e=>{s(e.currentTarget.value)}),[]),f=function(){const e=H(),t=r({apiVersion:"2021-10-21"});return E(((n,r,o)=>{const i=n.displayed?._id,a=n.displayed?.baseIri,s=n.displayed?.schemeId,c={_id:`drafts.${i}`,_type:"skosConceptScheme",schemeId:s,controls:!0,baseIri:a,title:r,description:o||""};t.createIfNotExists(c).then((t=>o?e.push({closable:!0,status:"success",title:"Title and Description added."}):e.push({closable:!0,status:"success",title:"Title added."}))).catch((t=>{e.push({closable:!0,status:"error",title:"There has been an error",description:t.message})}))}),[t,e])}(),m=E((()=>{f(e,o,a)}),[f,a,e,o]);return d(Zn,{children:[p(j,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:d(M,{space:6,children:[d(M,{space:4,children:[p(B,{size:4,children:"New Concept Scheme"}),p(z,{size:2,children:'To start using hierarchy view taxonomy builder, first give your concept scheme a name and optional description. You can also use the "Editor" tab to add concepts to the tree manually.'})]}),p(D,{tone:"primary",fontSize:2,icon:v,onClick:l,text:"Add Title"})]})}),t&&p(U,{header:"Title & Description",id:"title-description",onClose:c,zOffset:1e3,width:1,children:p(F,{padding:4,children:d(M,{space:4,children:[d(M,{space:2,children:[p(B,{size:1,children:"Title"}),p(z,{size:1,muted:!0,children:"Describe the concept scheme in one or two words."})]}),p(G,{fontSize:2,onChange:h,padding:3,placeholder:"",value:o}),d(M,{space:2,children:[p(B,{size:1,children:"Description (optional)"}),p(z,{size:1,muted:!0,children:"Describe the intended use of this concept scheme."})]}),p(Z,{fontSize:2,onChange:u,padding:3,placeholder:"",value:a,rows:3}),p(D,{tone:"primary",fontSize:2,onClick:m,text:"Save"})]})})})]})},Wr=()=>p(Zn,{children:p(j,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:d(M,{space:4,children:[p(B,{size:4,children:"No Concepts"}),p(z,{size:2,children:"There are not yet any concepts assigned to this scheme. To create a multi-level hierarchy with specific entry points, create Top Concepts first, then add children to them. To create a flat list of concepts, create Entry Concepts directly."})]})})}),Yr=({concepts:e,inputComponent:t,selectConcept:n})=>{const{globalVisibility:{treeId:r,treeVisibility:o}={treeId:123,treeVisibility:"open"}}=P(zr)||{};return null===e.topConcepts&&0===e.orphans.length?p(Wr,{}):d(Wn,{children:[e.topConcepts&&e.topConcepts.map((e=>p(qr,{concept:e,treeVisibility:o,inputComponent:t,selectConcept:n},e?.id+r))),e.orphans.map((e=>p(Gr,{concept:e,treeVisibility:o,inputComponent:t,selectConcept:n},e.id+r)))]})},Kr=({branchId:e="",selectConcept:t,inputComponent:n})=>{const r=P(Mr)||{},o=r.displayed?._id,{data:i,loading:a,error:s}=Nr({fetch:`\n select($branchId != null => \n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":*[_type == "skosConcept" && conceptId == $branchId]{\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Rr()}\n }, \n "orphans": []\n },\n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":topConcepts[]->|order(prefLabel){\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Rr()}\n }, \n "orphans": *[\n _id in coalesce(*[_id == 'drafts.' + $id][0], *[_id == $id][0]).concepts[]._ref &&\n count((broader[]._ref) [@ in coalesce(*[_id == 'drafts.' + $id][0], *[_id == $id][0]).topConcepts[]._ref]) < 1 &&\n count((broader[]._ref) [@ in coalesce(*[_id == 'drafts.' + $id][0], *[_id == $id][0]).concepts[]._ref]) < 1\n ]|order(prefLabel){\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Rr()}\n }\n }\n )`,listen:'*[_type == "skosConcept" || _id == $id]'},{params:{id:o,branchId:e}});return a?p(F,{padding:5,children:d(W,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[p(Y,{muted:!0}),p(z,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):s?(console.warn(s),p("div",{children:"error"})):i?p(zr.Provider,{value:{globalVisibility:{treeId:"123",treeVisibility:"open"}},children:p(F,{padding:4,children:p(Yr,{concepts:i,inputComponent:n,selectConcept:t})})}):p(Zr,{document:r})},Xr=({branchId:e="",selectConcept:t,inputComponent:n=!1})=>{const r=P(Mr)||{},o=r.displayed?._id,i=r.displayed?.concepts?.map((e=>e?._ref))||[],a=r.displayed?.concepts?.map((e=>`drafts.${e?._ref}`))||[],s=r.displayed?.topConcepts?.map((e=>e?._ref))||[],c=r.displayed?.topConcepts?.map((e=>`drafts.${e?._ref}`))||[],l=Hr(r),u=E((()=>{l("topConcept")}),[l]),f=E((()=>{l("concept")}),[l]),[m,y]=$({treeId:_(3),treeVisibility:"open"}),[b,v]=$(!1);T((()=>{r.displayed._id.includes("drafts.")||v(!1)}),[r.displayed._id]);const C=E((()=>{y({treeId:_(3),treeVisibility:"open"})}),[]),S=E((()=>{y({treeId:_(3),treeVisibility:"closed"})}),[]),k=E((()=>{v(!0)}),[]),{data:x,loading:I,error:N}=Nr({fetch:`*[_id == $id][0] {\n _updatedAt,\n "topConcepts": *[_id in $draftTopConceptIds ||\n (\n _id in $topConceptIds &&\n !(conceptId in *[_id in $draftTopConceptIds].conceptId)\n )\n ]|order(prefLabel) {\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Vr()}\n },\n "orphans": *[_id in $draftConceptIds ||\n (\n _id in $conceptIds &&\n !(conceptId in *[_id in $draftConceptIds].conceptId)\n ) &&\n count(\n (broader[]._ref) [@ in coalesce(\n *[_id == 'drafts.' + $id][0], \n *[_id == $id][0]\n ).topConcepts[]._ref]) < 1 &&\n count(\n (broader[]._ref) [@ in coalesce(\n *[_id == 'drafts.' + $id][0], \n *[_id == $id][0]\n ).concepts[]._ref]) < 1\n ]|order(prefLabel){\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Vr()}\n }\n }`,listen:'*[_type == "skosConcept" || _id == $id ]'},{params:{id:o,branchId:e,conceptIds:i,draftConceptIds:a,topConceptIds:s,draftTopConceptIds:c}});return I?p(F,{padding:5,children:d(W,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[p(Y,{muted:!0}),p(z,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):N?(console.error(N),p("div",{children:"Error here"})):x?p(zr.Provider,{value:{globalVisibility:m,editControls:b},children:p(F,{padding:4,paddingTop:2,children:d(h,{children:[p(M,{space:4,children:p(j,{borderBottom:!0,paddingBottom:1,display:"flex",flex:1,children:d(W,{justify:"space-between",flex:1,children:[p(j,{children:(x.topConcepts?.filter((e=>(e?.childConcepts?.length??0)>0)).length>0||x.orphans?.filter((e=>(e?.childConcepts?.length??0)>0)).length>0)&&d(L,{space:2,children:[p(Yn,{type:"button",onClick:S,children:p(z,{weight:"semibold",muted:!0,size:1,children:"Collapse"})}),p(z,{weight:"semibold",muted:!0,size:1,children:"|"}),p(Yn,{type:"button",onClick:C,children:p(z,{weight:"semibold",muted:!0,size:1,children:"Expand"})})]})}),p(j,{children:b?d(L,{space:4,children:[p(Yn,{type:"button",className:"add",onClick:u,children:d(z,{weight:"semibold",muted:!0,size:1,children:[p(g,{})," Add Top Concept"]})}),p(Yn,{type:"button",className:"add",onClick:f,children:d(z,{weight:"semibold",muted:!0,size:1,children:[p(g,{})," Add Concept"]})})]}):p(L,{space:2,children:p(Yn,{type:"button",onClick:k,children:d(z,{weight:"semibold",muted:!0,size:1,children:[p(w,{})," Edit"]})})})})]})})}),p(Yr,{concepts:x,inputComponent:n,selectConcept:t})]})})}):p(Zr,{document:r})},Jr=({document:e,branchId:t,selectConcept:n,inputComponent:r=!1})=>p(Mr.Provider,{value:e,children:r?p(Kr,{inputComponent:r,branchId:t,selectConcept:n}):d(K,{width:1,style:{paddingTop:"1.25rem"},children:[e?.displayed?.description&&p(F,{padding:4,children:p(M,{space:4,children:d(M,{space:2,children:[p(z,{size:1,weight:"semibold",children:"Description"}),p(z,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e?.displayed.description})]})})}),p(Xr,{inputComponent:r,branchId:t})]})});function Qr(t){const{name:n,title:o}=t,i=e(["_id"]),a=r({apiVersion:"2021-10-21"}),[s,c]=$(!1),[l,h]=$({}),{filter:u}=t.schemaType.options,f=u(),{schemeId:m,branchId:g=null}=f.params;T((()=>{a.fetch(`{"displayed": *[schemeId == "${m}"][0]}`).then((e=>{h(e)})).catch((e=>console.warn(e)))}),[a,m]);const y=E((()=>{c(!0)}),[]),b=E((()=>{c(!1)}),[]),v=E((e=>{i.includes("drafts.")?a.patch(i).set({[n]:e}).commit().then((()=>c(!1))).catch((e=>console.error(e))):a.fetch(`*[_id == "${i}"][0]`).then((t=>{t._id=`drafts.${t._id}`,t[n]=e,a.create(t)})).then((()=>c(!1))).catch((e=>console.error(e)))}),[a,i,n]);return d(M,{space:3,children:[t.renderDefault(t),p(X,{columns:1,gap:3,children:p(D,{text:"Browse Taxonomy Tree",mode:"ghost",onClick:y})}),s&&p(U,{header:o,id:"concept-select-dialog",onClose:b,zOffset:900,width:1,children:p(F,{padding:10,children:p(Jr,{document:l,branchId:g,inputComponent:!0,selectConcept:v})})})]})}var eo=[o({name:"baseIri",title:"Base URI",type:"url",validation:e=>e.required().error("Please supply a base URI in the format 'http://example.com/'"),description:d(Gn,{children:[p("summary",{children:"The root URI (Uniform Resource Identifier) used to create unique concept identifiers."}),d("div",{children:["Unique identifiers allow for the clear an unambiguous identification of concepts across namespaces, for example between ",p("code",{children:"https://shipparts.com/vocab#Bow"})," and ",p("code",{children:"https://wrappingsupplies.com/vocab#Bow"}),"."]}),p("div",{children:"In most cases, it makes sense for your base URI to be the root or a subdirectory of your website. In all cases, the URI you choose should be in a domain that you control."}),p("div",{children:"For new Concepts and Concept Schemes, the Base URI field is pre-populated based on the most recently used Base URI value."})]}),options:{collapsible:!0},components:{input:function(t){const n=e(["conceptId"]),r=e(["schemeId"]);return d(M,{space:2,children:[t.renderDefault(t),p(z,{muted:!0,size:1,onResize:void 0,onResizeCapture:void 0,children:d(h,{children:[p("strong",{children:"RDF URI: "}),t.value?t.value:"[base URI not defined] ",n||r||" [identifier not assigned]"]})})]})}}})];function to(e,t=[]){return i({name:"skosConcept",title:"Concept",type:"document",icon:S,initialValue:async(t,n)=>{if(e)return{baseIri:e,broader:[],related:[]};const{getClient:r}=n;return{baseIri:await r({apiVersion:"2021-03-25"}).fetch("\n *[(_type == 'skosConcept' || _type == 'skosConceptScheme') && defined(baseIri)]| order(_createdAt desc)[0].baseIri\n ")??void 0,broader:[],related:[]}},fields:[o({name:"prefLabel",title:"Preferred Label",type:"string",description:"The preferred lexical label for this concept.",validation:e=>e.required().custom(((e,t)=>{const{getClient:n}=t;return n({apiVersion:"2022-12-14"}).fetch(`*[_type == "skosConcept" && prefLabel == "${e}" && !(_id in path("drafts.**"))][0]._id`).then((e=>!e||e===t.document?._id.replace("drafts.","")||"Preferred Label must be unique."))}))}),o({name:"definition",title:"Definition",type:"text",description:d(Gn,{children:[p("summary",{children:"A complete explanation of the intended meaning of the concept."}),d("div",{children:[d("kbd",{children:["Example: documentation",p("br",{}),'Definition: "The process of storing and retrieving information in all fields of knowledge."']}),d("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",d("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),o({name:"example",title:"Examples",type:"text",description:d(Gn,{children:[p("summary",{children:"An example of the use of the concept."}),d("div",{children:[d("kbd",{children:["Example: organizations of science and culture",p("br",{}),'Example: "academies of science, general museums, world fairs"']}),d("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",d("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),o({name:"scopeNote",title:"Scope Note",type:"text",description:d(Gn,{children:[p("summary",{children:"A brief statement on the intended meaning of this concept, especially as an indication of how the use of the concept is limited in indexing practice."}),d("div",{children:[d("kbd",{children:["Example: microwave frequencies",p("br",{}),'Scope Note: "Used for frequencies between 1Ghz and 300Ghz"']}),d("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",d("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),o({name:"altLabel",title:"Alternate Label(s)",type:"array",description:d(Gn,{children:[p("summary",{children:"Synonyms, near-synonyms, abbreviations, and acronyms to a concept."}),p("div",{children:d("p",{children:[p(C,{})," Preferred, alternative, and hidden label sets must not overlap."]})})]}),of:[{type:"string"}],validation:e=>e.unique()}),o({name:"hiddenLabel",title:"Hidden Label(s)",type:"array",description:d(Gn,{children:[p("summary",{children:"Character strings that need to be accessible to applications performing text-based indexing and search operations, but which should not be displayed to end users."}),d("div",{children:[p("p",{children:"Hidden labels may for instance be used to include misspelled variants of other lexical labels."}),d("p",{children:[p(C,{})," Preferred, alternative, and hidden label sets must not overlap."]})]})]}),of:[{type:"string"}],validation:e=>e.unique()}),...eo,o({name:"conceptId",title:"Identifier",description:"This concept does not yet have a unique identifier.",type:"string",initialValue:()=>`${_(6)}`,hidden:({document:e})=>!!e?.conceptId,readOnly:({document:e})=>!!e?.conceptId,components:{input:or}}),o({name:"broader",title:"Broader Concept(s)",description:d(Gn,{children:[p("summary",{children:"Create hierarchy between concepts, for example to create category/subcategory, part/whole, or class/instance relationships."}),p("div",{children:p("p",{children:"Broader and Associated relationships are mutually exclusive."})})]}),type:"array",of:[{type:"reference",to:{type:"skosConcept"},options:{filter:({document:e})=>({filter:'!(_id in $broader || _id in $related || _id in path("drafts.**") || _id == $self)',params:{self:e._id.replace("drafts.",""),broader:e.broader.map((({_ref:e})=>e)),related:e.related.map((({_ref:e})=>e))}})}}]}),o({name:"related",title:"Related Concept(s)",description:d(Gn,{children:[p("summary",{children:'Indicate that two concepts are inherently "related", but that one is not in any way more general than the other.'}),p("div",{children:p("p",{children:"Broader and Associated relationships are mutually exclusive."})})]}),type:"array",of:[{type:"reference",to:[{type:"skosConcept"}]}]}),...t,o({name:"historyNote",title:"History Notes",type:"text",description:d(Gn,{children:[p("summary",{children:"Significant changes to the meaning of the form of this concept."}),d("div",{children:[d("kbd",{children:["Example: person with disabilities",p("br",{}),'History Note: "Estab. 1992; heading was: handicapped [1884 - 1992]."']}),d("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",d("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),o({name:"editorialNote",title:"Editorial Notes",type:"text",description:d(Gn,{children:[p("summary",{children:"Information to aid in administrative housekeeping, such as reminders of editorial work still to be done, or warnings in the event that future editorial changes might be made."}),d("div",{children:[d("kbd",{children:["Example: doubleclick",p("br",{}),'Editorial Note: "Review this term after the company merger is complete."']}),d("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",d("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),o({name:"changeNote",title:"Change Notes",type:"text",description:d(Gn,{children:[p("summary",{children:"Fine-grained changes to a concept, for the purposes of administration and maintenance."}),d("div",{children:[d("kbd",{children:["Example: tomato",p("br",{}),"Change Note: \"Moved from under 'fruits' to under 'vegetables' by Horace Gray\""]}),d("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",d("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3})],orderings:[{title:"Top Concepts",name:"topConcept",by:[{field:"topConcept",direction:"desc"},{field:"prefLabel",direction:"asc"}]},{title:"Preferred Label",name:"prefLabel",by:[{field:"prefLabel",direction:"asc"}]}],preview:{select:{title:"prefLabel"},prepare:({title:e})=>({title:e,media:k})}})}function no(){return p("svg",{"data-sanity-icon":!0,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p("path",{d:"M5.5 6.5V5.9H4.9V6.5H5.5ZM11.5 6.5H12.1V5.9H11.5V6.5ZM5.5 9H4.9V9.6H5.5V9ZM11.5 9V9.6H12.1V9H11.5ZM13.5 11V10.4H12.9V11H13.5ZM19.5 11H20.1V10.4H19.5V11ZM13.5 13.5H12.9V14.1H13.5V13.5ZM19.5 13.5V14.1H20.1V13.5H19.5ZM13.5 16V15.4H12.9V16H13.5ZM19.5 16H20.1V15.4H19.5V16ZM13.5 18.5H12.9V19.1H13.5V18.5ZM19.5 18.5V19.1H20.1V18.5H19.5ZM5.5 7.1H11.5V5.9H5.5V7.1ZM6.1 9V6.5H4.9V9H6.1ZM11.5 8.4H5.5V9.6H11.5V8.4ZM10.9 6.5V9H12.1V6.5H10.9ZM13.5 11.6H19.5V10.4H13.5V11.6ZM14.1 13.5V11H12.9V13.5H14.1ZM19.5 12.9H13.5V14.1H19.5V12.9ZM18.9 11V13.5H20.1V11H18.9ZM13.5 16.6H19.5V15.4H13.5V16.6ZM14.1 18.5V16H12.9V18.5H14.1ZM19.5 17.9H13.5V19.1H19.5V17.9ZM18.9 16V18.5H20.1V16H18.9ZM8 17.85H13.5V16.65H8V17.85ZM8 12.85H13.5V11.65H8V12.85ZM7.9 9.5V17.85H9.1V9.5H7.9Z",fill:"currentColor"})})}function ro(e,t=[]){return i({name:"skosConceptScheme",title:"Concept Scheme",type:"document",icon:no,initialValue:async(t,n)=>{if(e)return{baseIri:e};const{getClient:r}=n;return{baseIri:await r({apiVersion:"2021-03-25"}).fetch("\n *[(_type == 'skosConcept' || _type == 'skosConceptScheme') && defined(baseIri)]| order(_createdAt desc)[0].baseIri\n ")??void 0}},fields:[o({name:"title",title:"Title",type:"string",description:"Taxonomy schemes group concepts into defined sets, such as thesauri, classification schemes, or facets. Concepts may belong on many (or no) concept schemes, and you may create as many (or few) concept schemes as you like"}),o({name:"description",title:"Description",type:"text",rows:5,description:"Describe the intended use of this scheme."}),o({name:"controls",title:"Concept Management Controls",description:"Show concept management controls in hierarchy view",type:"boolean",initialValue:!0}),...eo,o({name:"schemeId",title:"Identifier",description:"This scheme does not yet have a unique identifier.",type:"string",initialValue:()=>`${_(6)}`,hidden:({document:e})=>!!e?.schemeId,readOnly:({document:e})=>!!e?.schemeId,components:{input:or}}),o({name:"topConcepts",title:"Top Concepts",type:"array",validation:e=>e.unique(),of:[a({type:"reference",to:[{type:"skosConcept"}]})],options:{sortable:!1}}),o({name:"concepts",title:"Concepts",type:"array",validation:e=>e.unique(),of:[a({type:"reference",to:[{type:"skosConcept"}]})],options:{sortable:!1}}),...t],preview:{select:{title:"title"},prepare:({title:e})=>({title:e,media:no})}})}function oo(e){const{schemeId:t}=e||{};return{filter:'!(_id in path("drafts.**"))\n && _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].concepts[]._ref\n || _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].topConcepts[]._ref',params:{schemeId:t}}}function io(e){const{schemeId:t,branchId:n}=e||{};return{filter:'!(_id in path("drafts.**")) && _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].concepts[]._ref \n && $branchId in broader[]->conceptId\n || $branchId in broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->broader[]->conceptId',params:{schemeId:t,branchId:n}}}const ao=e=>e.list().title("Taxonomy Manager").items([e.documentTypeListItem("skosConceptScheme").title("Concept Schemes"),e.documentTypeListItem("skosConcept").title("Concepts")]),so=(e,{schemaType:t})=>{switch(t){case"skosConceptScheme":return e.document().views([e.view.component(Jr).title("Tree View").icon(no),e.view.form().icon(w)]);case"skosConcept":return e.document().views([e.view.form().icon(w)]);default:e.view.form()}},co=s((e=>{const{baseUri:t,customConceptFields:n,customSchemeFields:r}=e||{};return{name:"taxonomyManager",options:e,schema:{types:[to(t,n),ro(t,r)]},plugins:[l({name:"taxonomy",title:"Taxonomy",structure:ao,defaultDocumentNode:so,icon:no})]}}));export{Qr as HierarchyInput,Jr as TreeView,io as branchFilter,oo as schemeFilter,co as taxonomyManager};//# sourceMappingURL=index.esm.esm.js.map
143
+ `,ir=Gn.p`
144
+ color: ${z.gray[800].hex};
145
+ `;const ar=e=>{const{onChange:n}=e,r=L(),o=T((()=>{n(t(k(6))),r.push({status:"success",title:"Identifier created.",closable:!0})}),[n,r]);return h(H,{space:2,children:h(j,{space:[3,3,4],children:h(U,{tone:"primary",fontSize:2,onClick:o,text:"Generate Identifier"})})})};var sr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},cr={},lr={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});var pr="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";dr.default=function(e){var t=e.split("-"),n=t[1],r=t[2],o=t[3];if(!n||!r||!o)throw new Error("Malformed asset _ref '".concat(e,"'. Expected an id like \"").concat(pr,'".'));var i=r.split("x"),a=+i[0],s=+i[1];if(!(isFinite(a)&&isFinite(s)))throw new Error("Malformed asset _ref '".concat(e,"'. Expected an id like \"").concat(pr,'".'));return{id:n,width:a,height:s,format:o}};var hr={},ur=sr&&sr.__assign||function(){return ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ur.apply(this,arguments)};Object.defineProperty(hr,"__esModule",{value:!0});function fr(e){var t=e.split("/").slice(-1);return"image-".concat(t[0]).replace(/\.([a-z]+)$/,"-$1")}hr.default=function(e){if(!e)return null;var t,n;if("string"==typeof e&&/^https?:\/\//.test("".concat(e)))t={asset:{_ref:fr(e)}};else if("string"==typeof e)t={asset:{_ref:e}};else if((n=e)&&"string"==typeof n._ref)t={asset:e};else if(function(e){return!!e&&"string"==typeof e._id}(e))t={asset:{_ref:e._id||""}};else if(function(e){var t=e;return!(!t||!t.asset)&&"string"==typeof t.asset.url}(e))t={asset:{_ref:fr(e.asset.url)}};else{if("object"!=typeof e.asset)return null;t=ur({},e)}var r=e;return r.crop&&(t.crop=r.crop),r.hotspot&&(t.hotspot=r.hotspot),function(e){if(e.crop&&e.hotspot)return e;var t=ur({},e);return t.crop||(t.crop={left:0,top:0,bottom:0,right:0}),t.hotspot||(t.hotspot={x:.5,y:.5,height:1,width:1}),t}(t)},function(e){var t=sr&&sr.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)},n=sr&&sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseSource=e.SPEC_NAME_TO_URL_NAME_MAPPINGS=void 0;var r=n(dr),o=n(hr);e.parseSource=o.default,e.SPEC_NAME_TO_URL_NAME_MAPPINGS=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"]],e.default=function(n){var i=t({},n||{}),a=i.source;delete i.source;var s=(0,o.default)(a);if(!s)throw new Error("Unable to resolve image URL from source (".concat(JSON.stringify(a),")"));var c=s.asset._ref||s.asset._id||"",l=(0,r.default)(c),d=Math.round(s.crop.left*l.width),p=Math.round(s.crop.top*l.height),h={left:d,top:p,width:Math.round(l.width-s.crop.right*l.width-d),height:Math.round(l.height-s.crop.bottom*l.height-p)},u=s.hotspot.height*l.height/2,f=s.hotspot.width*l.width/2,m=s.hotspot.x*l.width,g=s.hotspot.y*l.height,y={left:m-f,top:g-u,right:m+f,bottom:g+u};return i.rect||i.focalPoint||i.ignoreImageParams||i.crop||(i=t(t({},i),function(e,t){var n,r=t.width,o=t.height;if(!r||!o)return{width:r,height:o,rect:e.crop};var i=e.crop,a=e.hotspot,s=r/o,c=i.width/i.height;if(c>s){var l=Math.round(i.height),d=Math.round(l*s),p=Math.max(0,Math.round(i.top)),h=Math.round((a.right-a.left)/2+a.left);(u=Math.max(0,Math.round(h-d/2)))<i.left?u=i.left:u+d>i.left+i.width&&(u=i.left+i.width-d),n={left:u,top:p,width:d,height:l}}else{d=i.width,l=Math.round(d/s);var u=Math.max(0,Math.round(i.left)),f=Math.round((a.bottom-a.top)/2+a.top),m=Math.max(0,Math.round(f-l/2));m<i.top?m=i.top:m+l>i.top+i.height&&(m=i.top+i.height-l),n={left:u,top:m,width:d,height:l}}return{width:r,height:o,rect:n}}({crop:h,hotspot:y},i))),function(t){var n=(t.baseUrl||"https://cdn.sanity.io").replace(/\/+$/,""),r="".concat(t.asset.id,"-").concat(t.asset.width,"x").concat(t.asset.height,".").concat(t.asset.format),o="".concat(n,"/images/").concat(t.projectId,"/").concat(t.dataset,"/").concat(r),i=[];if(t.rect){var a=t.rect,s=a.left,c=a.top,l=a.width,d=a.height;(0!==s||0!==c||d!==t.asset.height||l!==t.asset.width)&&i.push("rect=".concat(s,",").concat(c,",").concat(l,",").concat(d))}t.bg&&i.push("bg=".concat(t.bg)),t.focalPoint&&(i.push("fp-x=".concat(t.focalPoint.x)),i.push("fp-y=".concat(t.focalPoint.y)));var p=[t.flipHorizontal&&"h",t.flipVertical&&"v"].filter(Boolean).join("");return p&&i.push("flip=".concat(p)),e.SPEC_NAME_TO_URL_NAME_MAPPINGS.forEach((function(e){var n=e[0],r=e[1];typeof t[n]<"u"?i.push("".concat(r,"=").concat(encodeURIComponent(t[n]))):typeof t[r]<"u"&&i.push("".concat(r,"=").concat(encodeURIComponent(t[r])))})),0===i.length?o:"".concat(o,"?").concat(i.join("&"))}(t(t({},i),{asset:l}))}}(lr);var mr=sr&&sr.__assign||function(){return mr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mr.apply(this,arguments)},gr=sr&&sr.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),yr=sr&&sr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),br=sr&&sr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&gr(t,e,n);return yr(t,e),t};Object.defineProperty(cr,"__esModule",{value:!0}),cr.ImageUrlBuilder=void 0;var vr=br(lr),wr=["clip","crop","fill","fillmax","max","scale","min"],Cr=["top","bottom","left","right","center","focalpoint","entropy"],_r=["format"];function Sr(e){for(var t=0,n=vr.SPEC_NAME_TO_URL_NAME_MAPPINGS;t<n.length;t++){var r=n[t],o=r[0],i=r[1];if(e===o||e===i)return o}return e}cr.default=function(e){if(function(e){return!(!e||!("config"in e))&&"function"==typeof e.config}(e)){var t=e.config(),n=t.apiHost,r=t.projectId,o=t.dataset;return new kr(null,{baseUrl:(n||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:r,dataset:o})}var i=e;if(function(e){return!(!e||!("clientConfig"in e))&&"object"==typeof e.clientConfig}(i)){var a=i.clientConfig;n=a.apiHost,r=a.projectId,o=a.dataset;return new kr(null,{baseUrl:(n||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:r,dataset:o})}return new kr(null,e)};var kr=function(){function e(e,t){this.options=mr(e?mr({},e.options||{}):{},t||{})}return e.prototype.withOptions=function(t){var n=t.baseUrl||this.options.baseUrl,r={baseUrl:n};for(var o in t)if(t.hasOwnProperty(o)){r[Sr(o)]=t[o]}return new e(this,mr({baseUrl:n},r))},e.prototype.image=function(e){return this.withOptions({source:e})},e.prototype.dataset=function(e){return this.withOptions({dataset:e})},e.prototype.projectId=function(e){return this.withOptions({projectId:e})},e.prototype.bg=function(e){return this.withOptions({bg:e})},e.prototype.dpr=function(e){return this.withOptions(e&&1!==e?{dpr:e}:{})},e.prototype.width=function(e){return this.withOptions({width:e})},e.prototype.height=function(e){return this.withOptions({height:e})},e.prototype.focalPoint=function(e,t){return this.withOptions({focalPoint:{x:e,y:t}})},e.prototype.maxWidth=function(e){return this.withOptions({maxWidth:e})},e.prototype.minWidth=function(e){return this.withOptions({minWidth:e})},e.prototype.maxHeight=function(e){return this.withOptions({maxHeight:e})},e.prototype.minHeight=function(e){return this.withOptions({minHeight:e})},e.prototype.size=function(e,t){return this.withOptions({width:e,height:t})},e.prototype.blur=function(e){return this.withOptions({blur:e})},e.prototype.sharpen=function(e){return this.withOptions({sharpen:e})},e.prototype.rect=function(e,t,n,r){return this.withOptions({rect:{left:e,top:t,width:n,height:r}})},e.prototype.format=function(e){return this.withOptions({format:e})},e.prototype.invert=function(e){return this.withOptions({invert:e})},e.prototype.orientation=function(e){return this.withOptions({orientation:e})},e.prototype.quality=function(e){return this.withOptions({quality:e})},e.prototype.forceDownload=function(e){return this.withOptions({download:e})},e.prototype.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},e.prototype.flipVertical=function(){return this.withOptions({flipVertical:!0})},e.prototype.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},e.prototype.fit=function(e){if(-1===wr.indexOf(e))throw new Error('Invalid fit mode "'.concat(e,'"'));return this.withOptions({fit:e})},e.prototype.crop=function(e){if(-1===Cr.indexOf(e))throw new Error('Invalid crop mode "'.concat(e,'"'));return this.withOptions({crop:e})},e.prototype.saturation=function(e){return this.withOptions({saturation:e})},e.prototype.auto=function(e){if(-1===_r.indexOf(e))throw new Error('Invalid auto mode "'.concat(e,'"'));return this.withOptions({auto:e})},e.prototype.pad=function(e){return this.withOptions({pad:e})},e.prototype.url=function(){return(0,vr.default)(this.options)},e.prototype.toString=function(){return this.url()},e}();cr.ImageUrlBuilder=kr,(sr&&sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(cr);const xr={},Ir={apiVersion:"v2023-05-01"},Nr=null;function Or(e){const t=V((()=>JSON.stringify(e||{})),[e]);return V((()=>JSON.parse(t)),[t])}function Er(e,t){let{params:r=xr,options:o=Ir,initialValue:i=Nr}=t;const[a,s]=A(!0),[c,l]=A(!1),[d,p]=A(i),h=Or(r),u=Or(o),f=O(null),m=n();return R((()=>{if(e&&!c&&!f.current)try{f.current=m.listenQuery(e,h,u).pipe(te(ee),ne((e=>(console.error(e),l(e),s(!1),p(null),e)))).subscribe((e=>{p((t=>ee(t,e)?t:e)),s(!1),l(!1)}))}catch(e){console.error(e),s(!1),l(e)}return c&&f.current&&f.current.unsubscribe(),()=>{var e;f.current&&(null==(e=f?.current)||e.unsubscribe(),f.current=null)}}),[e,c,h,u,m]),{data:d,loading:a,error:c}}var Pr,$r,Tr,Ar=Object.freeze,Rr=Object.defineProperty,Vr=(e,t)=>Ar(Rr(e,"raw",{value:Ar(e.slice())}));Gn((function(){return h(F,{as:"table",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})}))((()=>Fn(Pr||(Pr=Vr(["\n display: table;\n width: 100%;\n border-collapse: collapse;\n\n &:not([hidden]) {\n display: table;\n border-collapse: collapse;\n }\n "])))));Gn((function(){return h(F,{as:"tr",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})}))((()=>Fn($r||($r=Vr(["\n display: table-row;\n\n &:not([hidden]) {\n display: table-row;\n }\n "])))));Gn((function(){return h(F,{as:"td",...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})}))((()=>Fn(Tr||(Tr=Vr(["\n display: table-cell;\n\n &:not([hidden]) {\n display: table-cell;\n }\n "])))));const Mr=(e=1)=>e>6?"":`"childConcepts": *[\n (_id in $draftConceptIds ||\n (\n _id in $conceptIds &&\n !(conceptId in $draftConceptIds)\n )\n ) && ^._id in broader[]._ref ]|order(prefLabel){\n "id": _id,\n "level": ${e},\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Mr(e+1)}\n }`,zr=(e=1)=>e>6?"":`"childConcepts": *[_id in *[_id == $id][0].concepts[]._ref && ^._id in broader[]._ref ]|order(prefLabel){\n "id": _id,\n "level": ${e},\n prefLabel,\n definition,\n example,\n scopeNote,\n ${zr(e+1)}\n }`,Hr=M(null),Dr=M({editControls:!1});function Lr(e){const t=L(),n=r({apiVersion:"2021-10-21"}),o=function(){const e=$(re),{routerPanesState:t,groupIndex:n}=l();return T((r=>{if(!e||!r)return;const o=[...t];o.splice(n+1,n+1,[{id:r,params:{type:"skosConcept"}}]);const i=e.resolvePathFromState({panes:o});e.navigateUrl({path:i})}),[e,t,n])}(),i=e.displayed.baseIri;return T(((r,a,s)=>{let c;c=a?{_id:`drafts.${k()}`,_type:"skosConcept",conceptId:`${k(6)}`,prefLabel:"",baseIri:i,broader:[a&&{_key:k(6),_ref:a,_type:"reference"}],related:[]}:{_id:`drafts.${k()}`,_type:"skosConcept",conceptId:`${k(6)}`,prefLabel:"",baseIri:i,broader:[],related:[]};const l=JSON.parse(JSON.stringify(e.displayed));l._id.includes("drafts.")||(l._id=`drafts.${l._id}`),n.transaction().createIfNotExists(l).create(c).patch(l._id,(e=>"topConcept"==r?e.setIfMissing({topConcepts:[]}).append("topConcepts",[{_ref:c._id.replace("drafts.",""),_type:"reference",_key:k(6),_weak:!0,_strengthenOnPublish:{_type:"skosConcept",weak:!0,template:{id:"skosConcept",params:"undefined"}}}]):e.setIfMissing({concepts:[]}).insert("after","concepts[-1]",[{_ref:c._id.replace("drafts.",""),_type:"reference",_key:k(6),_weak:!0,_strengthenOnPublish:{_type:"skosConcept",weak:void 0,template:{id:"skosConcept",params:"undefined"}}}]))).commit({autoGenerateArrayKeys:!0}).then((e=>{t.push({closable:!0,status:"success",title:"Created new concept"}),o(c._id)})).catch((e=>{t.push({closable:!0,status:"error",title:"Error creating concept",description:e.message})}))}),[e.displayed,n,i,t,o])}function jr(e){const t=L(),n=r({apiVersion:"2021-10-21"});return T(((r,o,i)=>{const a="topConcept"==o?"topConcepts":"concepts",s=JSON.parse(JSON.stringify(e.displayed));s._id.includes("drafts.")||(s._id=`drafts.${s._id}`),n.transaction().createIfNotExists(s).patch(s._id,(e=>e.unset([`${a}[_ref=="${r.replace("drafts.","")}"]`]))).commit().then((e=>{t.push({closable:!0,status:"success",title:(i?`"${i}"`:"Concept")+" removed from scheme"})})).catch((e=>{t.push({closable:!0,status:"error",title:"Error removing concept",description:e.message})}))}),[n,e.displayed,t])}function Ur({concept:e}){const t=$(re),{routerPanesState:n,groupIndex:r}=l(),{id:o,prefLabel:i}=e??{},a=T((()=>{if(!t||!o)return;const e=[...n];e.splice(r+1,r+1,[{id:o,params:{type:"skosConcept"}}]);const i=t.resolvePathFromState({panes:e});t.navigateUrl({path:i})}),[o,t,n,r]);return h(or,{href:"#",onClick:a,children:i})}const Fr=({concept:e})=>{const[t,n]=A(!1),r=T((()=>n(!1)),[]),o=T((()=>n(!0)),[]);return e&&(e.definition||e.example||e.scopeNote)?p(u,{children:[h(Jn,{className:"action","aria-label":"info",onClick:o,type:"button",children:h(f,{className:"info"})}),t&&h(B,{header:e.prefLabel,id:"dialog-example",onClose:r,zOffset:1e3,width:1,children:h(q,{padding:4,paddingBottom:5,children:p(H,{space:4,children:[e.definition&&p(H,{space:2,children:[h(G,{size:1,children:"Definition"}),h(D,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.definition})]}),e.example&&p(H,{space:2,children:[h(G,{size:1,children:"Example"}),h(D,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.example})]}),e.scopeNote&&p(H,{space:2,children:[h(G,{size:1,children:"Scope Note"}),h(D,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e.scopeNote})]})]})})})]}):null};function Br({concept:e,selectConcept:t}){const{prefLabel:n,id:r}=e??{},o=T((()=>{t({_ref:r,_type:"reference"})}),[r,t]);return h(u,{children:t?h(or,{href:"#",onClick:o,children:n}):h(ir,{children:n})})}const qr=({concept:e,selectConcept:t,inputComponent:n=!1})=>{const r=$(Hr)||{},{globalVisibility:{treeVisibility:o}}=$(Dr)||{},{editControls:i}=$(Dr)||{editControls:!1},a=Lr(r),s=jr(r),c=T((()=>{a("concept",e?.id,e?.prefLabel)}),[e?.id,e?.prefLabel,a]),l=T((()=>{s(e.id,"concept",e?.prefLabel)}),[e.id,e?.prefLabel,s]),[d,u]=A(o),w=T((()=>{"open"==d?u("closed"):"closed"==d&&u("open")}),[d]);return p(rr,{className:d,children:[p(j,{space:2,children:[p(j,{space:1,children:[p(j,{space:1,children:[e?.childConcepts&&e.childConcepts.length>0&&h(Qn,{onClick:w,type:"button","aria-expanded":"open"==d,children:h(m,{})}),e?.childConcepts&&0==e.childConcepts.length&&h(g,{className:"spacer"}),!e?.prefLabel&&h("span",{className:"untitled",children:"[new concept]"}),n?h(Br,{concept:e,selectConcept:t}):h(Ur,{concept:e})]}),!i&&h(Fr,{concept:e})]}),i&&e?.level&&e.level<5&&p(j,{space:2,children:[h(Jn,{onClick:c,type:"button",className:"action","aria-label":"Add child a child concept",children:h(y,{className:"add"})}),h(Jn,{onClick:l,type:"button",className:"action","aria-label":"Remove concept from scheme",children:h(b,{className:"remove"})})]}),i&&0==e.childConcepts?.length&&5==e.level&&p(j,{space:2,children:[h(Z,{content:h(q,{padding:2,sizing:"border",children:h(H,{padding:1,space:2,children:h(D,{muted:!0,size:1,children:"This concept is at the maximum Taxonomy Manager hierarchy depth of 5 levels."})})}),fallbackPlacements:["right","left"],placement:"top",children:h(f,{className:"info warning"})}),h(Jn,{onClick:l,type:"button",className:"action","aria-label":"Remove concept from scheme",children:h(b,{className:"remove"})})]}),e?.childConcepts&&e?.childConcepts?.length>0&&5==e.level&&p(j,{space:1,children:[h(Z,{content:h(q,{padding:2,sizing:"border",children:p(H,{padding:1,space:2,children:[h(D,{muted:!0,size:1,children:"This concept has unlisted child concepts."}),h(D,{muted:!0,size:1,children:"The maximum hierarchy depth is 5 levels."})]})}),fallbackPlacements:["right","left"],placement:"top",children:h(v,{className:"info error"})}),r.displayed?.controls&&h(Jn,{onClick:l,type:"button",className:"action","aria-label":"Remove concept from scheme",children:h(b,{className:"remove"})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&e?.level&&e.level<5&&h(Gr,{concepts:e.childConcepts,selectConcept:t,inputComponent:n})]})},Gr=({concepts:e,inputComponent:t=!1,selectConcept:n})=>h(nr,{children:e.map((e=>h(qr,{concept:e,selectConcept:n,inputComponent:t},e.id)))}),Zr=({concept:e,treeVisibility:t,inputComponent:n,selectConcept:r})=>{const o=$(Hr)||{},{editControls:i}=$(Dr)||{editControls:!1},a=Lr(o),s=jr(o),[c,l]=A(t),d=T((()=>{"open"==c?l("closed"):"closed"==c&&l("open")}),[c]),u=T((()=>{a("concept",e?.id,e?.prefLabel)}),[e?.id,e?.prefLabel,a]),f=T((()=>{s(e?.id,"topConcept",e?.prefLabel)}),[e?.id,e?.prefLabel,s]);return p(er,{className:c,children:[p(j,{space:2,children:[p(j,{space:0,children:[e?.childConcepts&&e.childConcepts.length>0&&h(Qn,{onClick:d,type:"button","aria-expanded":"open"==c,children:h(m,{})}),e?.childConcepts&&0==e.childConcepts.length&&h(g,{className:"spacer"}),!e?.prefLabel&&h("span",{className:"untitled",children:"[new concept]"}),n?h(Br,{concept:e,selectConcept:r}):h(Ur,{concept:e})]}),h(D,{size:1,muted:!0,children:"top concept"}),!i&&h(Fr,{concept:e}),i&&p(j,{space:2,children:[h(Z,{content:h(q,{padding:2,sizing:"border",children:h(H,{padding:1,space:2,children:h(D,{muted:!0,size:1,children:"Add a child concept"})})}),fallbackPlacements:["right","left"],placement:"top",children:h(Jn,{onClick:u,type:"button",className:"action","aria-label":"Add child a child concept",children:h(y,{className:"add"})})}),h(Z,{content:h(q,{padding:2,sizing:"border",children:h(H,{padding:1,space:2,children:h(D,{muted:!0,size:1,children:"Remove concept from scheme"})})}),fallbackPlacements:["right","left"],placement:"top",children:h(Jn,{onClick:f,type:"button",className:"action","aria-label":"Remove concept from scheme",children:h(b,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&h(Gr,{concepts:e.childConcepts,selectConcept:r,inputComponent:n})]})},Wr=({concept:e,treeVisibility:t,inputComponent:n,selectConcept:r})=>{const o=$(Hr)||{},{editControls:i}=$(Dr)||{editControls:!1},a=Lr(o),s=jr(o),[c,l]=A(t),d=T((()=>{"open"==c?l("closed"):"closed"==c&&l("open")}),[c]),u=T((()=>{a("concept",e?.id,e?.prefLabel)}),[e?.id,e?.prefLabel,a]),f=T((()=>{s(e.id,"concept",e?.prefLabel)}),[e.id,e?.prefLabel,s]);return p(tr,{className:c,children:[p(j,{space:2,children:[e?.childConcepts&&e.childConcepts.length>0&&(n?h(g,{className:"spacer"}):h(Qn,{onClick:d,type:"button","aria-expanded":"open"==c,children:h(m,{})})),e?.childConcepts&&0==e.childConcepts.length&&h(g,{className:"spacer"}),!e?.prefLabel&&h("span",{className:"untitled",children:"[new concept]"}),n?h(Br,{concept:e,selectConcept:r}):h(Ur,{concept:e}),o.displayed?.topConcepts?.length>0&&h(D,{size:1,muted:!0,children:"orphan"}),!i&&h(Fr,{concept:e}),!n&&i&&p(j,{space:2,children:[h(Z,{content:h(q,{padding:2,sizing:"border",children:h(H,{padding:1,space:2,children:h(D,{muted:!0,size:1,children:"Add a child concept"})})}),fallbackPlacements:["right","left"],placement:"top",children:h(Jn,{onClick:u,type:"button",className:"action","aria-label":"Add child a child concept",children:h(y,{className:"add"})})}),h(Z,{content:h(q,{padding:2,sizing:"border",children:h(H,{padding:1,space:2,children:h(D,{muted:!0,size:1,children:"Remove concept from scheme"})})}),fallbackPlacements:["right","left"],placement:"top",children:h(Jn,{onClick:f,type:"button",className:"action","aria-label":"Remove concept from scheme",children:h(b,{className:"remove"})})})]})]}),e?.childConcepts&&e.childConcepts.length>0&&h(Gr,{concepts:e.childConcepts,selectConcept:r,inputComponent:n})]})},Yr=({document:e})=>{const[t,n]=A(!1),[o,i]=A(""),[a,s]=A(""),c=T((()=>n(!1)),[]),l=T((()=>n(!0)),[]),d=T((e=>{i(e.currentTarget.value)}),[]),u=T((e=>{s(e.currentTarget.value)}),[]),f=function(){const e=L(),t=r({apiVersion:"2021-10-21"});return T(((n,r,o)=>{const i=n.displayed?._id,a=n.displayed?.baseIri,s=n.displayed?.schemeId,c={_id:`drafts.${i}`,_type:"skosConceptScheme",schemeId:s,baseIri:a,title:r,description:o||""};t.createIfNotExists(c).then((t=>o?e.push({closable:!0,status:"success",title:"Title and Description added."}):e.push({closable:!0,status:"success",title:"Title added."}))).catch((t=>{e.push({closable:!0,status:"error",title:"There has been an error",description:t.message})}))}),[t,e])}(),m=T((()=>{f(e,o,a)}),[f,a,e,o]);return p(Yn,{children:[h(F,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:p(H,{space:6,children:[p(H,{space:4,children:[h(G,{size:4,children:"New Concept Scheme"}),h(D,{size:2,children:'To start using hierarchy view taxonomy builder, first give your concept scheme a name and optional description. You can also use the "Editor" tab to add concepts to the tree manually.'})]}),h(U,{tone:"primary",fontSize:2,icon:w,onClick:l,text:"Add Title"})]})}),t&&h(B,{header:"Title & Description",id:"title-description",onClose:c,zOffset:1e3,width:1,children:h(q,{padding:4,children:p(H,{space:4,children:[p(H,{space:2,children:[h(G,{size:1,children:"Title"}),h(D,{size:1,muted:!0,children:"Describe the concept scheme in one or two words."})]}),h(W,{fontSize:2,onChange:d,padding:3,placeholder:"",value:o}),p(H,{space:2,children:[h(G,{size:1,children:"Description (optional)"}),h(D,{size:1,muted:!0,children:"Describe the intended use of this concept scheme."})]}),h(Y,{fontSize:2,onChange:u,padding:3,placeholder:"",value:a,rows:3}),h(U,{tone:"primary",fontSize:2,onClick:m,text:"Save"})]})})})]})},Kr=()=>h(Yn,{children:h(F,{padding:[3,3,4],radius:2,shadow:1,tone:"primary",children:p(H,{space:4,children:[h(G,{size:4,children:"No Concepts"}),h(D,{size:2,children:"There are not yet any concepts assigned to this scheme. To create a multi-level hierarchy with specific entry points, create Top Concepts first, then add children to them. To create a flat list of concepts, create Entry Concepts directly."})]})})}),Xr=({concepts:e,inputComponent:t,selectConcept:n})=>{const{globalVisibility:{treeId:r,treeVisibility:o}={treeId:123,treeVisibility:"open"},setEditControls:i=()=>{console.warn("setEditControls not defined")}}=$(Dr)||{};return R((()=>{0===e.topConcepts.length&&0===e.orphans.length&&i(!0)}),[e.topConcepts,e.orphans,i]),0===e.topConcepts.length&&0===e.orphans.length?h(Kr,{}):p(Kn,{children:[e.topConcepts&&e.topConcepts.map((e=>h(Zr,{concept:e,treeVisibility:o,inputComponent:t,selectConcept:n},e?.id+r))),e.orphans.map((e=>h(Wr,{concept:e,treeVisibility:o,inputComponent:t,selectConcept:n},e.id+r)))]})},Jr=({branchId:e="",selectConcept:t,inputComponent:n})=>{const r=$(Hr)||{},o=r.displayed?._id,{data:i,loading:a,error:s}=Er({fetch:`\n select($branchId != null => \n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":*[_type == "skosConcept" && conceptId == $branchId]{\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${zr()}\n }, \n "orphans": []\n },\n *[_id == $id][0] {\n _updatedAt,\n "topConcepts":topConcepts[]->|order(prefLabel){\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${zr()}\n }, \n "orphans": *[\n _id in coalesce(*[_id == 'drafts.' + $id][0], *[_id == $id][0]).concepts[]._ref &&\n count((broader[]._ref) [@ in coalesce(*[_id == 'drafts.' + $id][0], *[_id == $id][0]).topConcepts[]._ref]) < 1 &&\n count((broader[]._ref) [@ in coalesce(*[_id == 'drafts.' + $id][0], *[_id == $id][0]).concepts[]._ref]) < 1\n ]|order(prefLabel){\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${zr()}\n }\n }\n )`,listen:'*[_type == "skosConcept" || _id == $id]'},{params:{id:o,branchId:e}});return a?h(q,{padding:5,children:p(K,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[h(X,{muted:!0}),h(D,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):s?(console.warn(s),h("div",{children:"error"})):i?h(Dr.Provider,{value:{globalVisibility:{treeId:"123",treeVisibility:"open"}},children:h(q,{padding:4,children:h(Xr,{concepts:i,inputComponent:n,selectConcept:t})})}):h(Yr,{document:r})},Qr=({branchId:e="",selectConcept:t,inputComponent:n=!1})=>{const r=$(Hr)||{},o=r.displayed?._id,i=r.displayed?.concepts?.map((e=>e?._ref))||[],a=r.displayed?.concepts?.map((e=>`drafts.${e?._ref}`))||[],s=r.displayed?.topConcepts?.map((e=>e?._ref))||[],c=r.displayed?.topConcepts?.map((e=>`drafts.${e?._ref}`))||[],l=Lr(r),d=T((()=>{l("topConcept")}),[l]),f=T((()=>{l("concept")}),[l]),[m,g]=A({treeId:k(3),treeVisibility:"open"}),[b,v]=A(!1);R((()=>{r.displayed._id.includes("drafts.")||v(!1)}),[r.displayed._id]);const w=T((()=>{g({treeId:k(3),treeVisibility:"open"})}),[]),S=T((()=>{g({treeId:k(3),treeVisibility:"closed"})}),[]),x=T((()=>{v(!0)}),[]),I=T((()=>{v(!1)}),[]),{data:N,loading:O,error:E}=Er({fetch:`*[_id == $id][0] {\n _updatedAt,\n "topConcepts": *[_id in $draftTopConceptIds ||\n (\n _id in $topConceptIds &&\n !(conceptId in *[_id in $draftTopConceptIds].conceptId)\n )\n ]|order(prefLabel) {\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Mr()}\n },\n "orphans": *[_id in $draftConceptIds ||\n (\n _id in $conceptIds &&\n !(conceptId in *[_id in $draftConceptIds].conceptId)\n ) &&\n count(\n (broader[]._ref) [@ in coalesce(\n *[_id == 'drafts.' + $id][0], \n *[_id == $id][0]\n ).topConcepts[]._ref]) < 1 &&\n count(\n (broader[]._ref) [@ in coalesce(\n *[_id == 'drafts.' + $id][0], \n *[_id == $id][0]\n ).concepts[]._ref]) < 1\n ]|order(prefLabel){\n "id": _id,\n "level": 0,\n prefLabel,\n definition,\n example,\n scopeNote,\n ${Mr()}\n }\n }`,listen:'*[_type == "skosConcept" || _id == $id ]'},{params:{id:o,branchId:e,conceptIds:i,draftConceptIds:a,topConceptIds:s,draftTopConceptIds:c}});return O?h(q,{padding:5,children:p(K,{align:"center",direction:"column",gap:5,height:"fill",justify:"center",style:{paddingTop:"1rem"},children:[h(X,{muted:!0}),h(D,{muted:!0,size:1,children:"Loading hierarchy…"})]})}):E?(console.error(E),h("div",{children:"Error here"})):N?h(Dr.Provider,{value:{globalVisibility:m,editControls:b,setEditControls:v},children:h(q,{padding:4,paddingTop:2,children:p(u,{children:[h(H,{space:4,children:h(F,{borderBottom:!0,paddingBottom:1,display:"flex",flex:1,children:p(K,{justify:"space-between",flex:1,children:[h(F,{children:(N.topConcepts?.filter((e=>(e?.childConcepts?.length??0)>0)).length>0||N.orphans?.filter((e=>(e?.childConcepts?.length??0)>0)).length>0)&&p(j,{space:1,children:[h(Xn,{type:"button",onClick:S,children:h(D,{weight:"semibold",muted:!0,size:1,children:"Collapse"})}),h(D,{weight:"semibold",muted:!0,size:1,children:"|"}),h(Xn,{type:"button",onClick:w,children:h(D,{weight:"semibold",muted:!0,size:1,children:"Expand"})})]})}),h(F,{children:b?p(j,{space:1,children:[h(Xn,{type:"button",className:"add",onClick:d,children:p(D,{weight:"semibold",muted:!0,size:1,children:[h(y,{})," Add Top Concept"]})}),h(Xn,{type:"button",className:"add",onClick:f,children:p(D,{weight:"semibold",muted:!0,size:1,children:[h(y,{})," Add Concept"]})}),h(Xn,{type:"button",onClick:I,children:p(D,{weight:"semibold",muted:!0,size:1,children:[h(C,{})," Done"]})})]}):h(j,{space:2,children:h(Xn,{type:"button",onClick:x,children:p(D,{weight:"semibold",muted:!0,size:1,children:[h(_,{})," Edit"]})})})})]})})}),h(Xr,{concepts:N,inputComponent:n,selectConcept:t})]})})}):h(Yr,{document:r})},eo=({document:e,branchId:t,selectConcept:n,inputComponent:r=!1})=>h(Hr.Provider,{value:e,children:r?h(Jr,{inputComponent:r,branchId:t,selectConcept:n}):p(J,{width:1,style:{paddingTop:"1.25rem"},children:[e?.displayed?.description&&h(q,{padding:4,children:h(H,{space:4,children:p(H,{space:2,children:[h(D,{size:1,weight:"semibold",children:"Description"}),h(D,{size:2,muted:!0,style:{whiteSpace:"pre-wrap"},children:e?.displayed.description})]})})}),h(Qr,{inputComponent:r,branchId:t})]})});function to(t){const{name:n,title:o}=t,i=e(["_id"]),a=r({apiVersion:"2021-10-21"}),[s,c]=A(!1),[l,d]=A({}),{filter:u}=t.schemaType.options,f=u(),{schemeId:m,branchId:g=null}=f.params;R((()=>{a.fetch(`{"displayed": *[schemeId == "${m}"][0]}`).then((e=>{d(e)})).catch((e=>console.warn(e)))}),[a,m]);const y=T((()=>{c(!0)}),[]),b=T((()=>{c(!1)}),[]),v=T((e=>{i.includes("drafts.")?a.patch(i).set({[n]:e}).commit().then((()=>c(!1))).catch((e=>console.error(e))):a.fetch(`*[_id == "${i}"][0]`).then((t=>{t._id=`drafts.${t._id}`,t[n]=e,a.create(t)})).then((()=>c(!1))).catch((e=>console.error(e)))}),[a,i,n]);return p(H,{space:3,children:[t.renderDefault(t),h(Q,{columns:1,gap:3,children:h(U,{text:"Browse Taxonomy Tree",mode:"ghost",onClick:y})}),s&&h(B,{header:o,id:"concept-select-dialog",onClose:b,zOffset:900,width:1,children:h(q,{padding:10,children:h(eo,{document:l,branchId:g,inputComponent:!0,selectConcept:v})})})]})}const no=e=>{const{onChange:t}=e,n=L(),r=T((()=>{t(o()),n.push({status:"success",title:"Value removed.",duration:2500,closable:!0})}),[t,n]);return h(H,{space:2,children:p(j,{space:[3,3,4],children:[e.renderDefault(e),h(U,{tone:"primary",fontSize:2,onClick:r,text:"Remove Value"})]})})};var ro=[i({name:"baseIri",title:"Base URI",type:"url",validation:e=>e.required().error("Please supply a base URI in the format 'http://example.com/'"),description:p(Wn,{children:[h("summary",{children:"The root URI (Uniform Resource Identifier) used to create unique concept identifiers."}),p("div",{children:["Unique identifiers allow for the clear an unambiguous identification of concepts across namespaces, for example between ",h("code",{children:"https://shipparts.com/vocab#Bow"})," and ",h("code",{children:"https://wrappingsupplies.com/vocab#Bow"}),"."]}),h("div",{children:"In most cases, it makes sense for your base URI to be the root or a subdirectory of your website. In all cases, the URI you choose should be in a domain that you control."}),h("div",{children:"For new Concepts and Concept Schemes, the Base URI field is pre-populated based on the most recently used Base URI value."})]}),options:{collapsible:!0},components:{input:function(t){const n=e(["conceptId"]),r=e(["schemeId"]);return p(H,{space:2,children:[t.renderDefault(t),h(D,{muted:!0,size:1,onResize:void 0,onResizeCapture:void 0,children:p(u,{children:[h("strong",{children:"RDF URI: "}),t.value?t.value:"[base URI not defined] ",n||r||" [identifier not assigned]"]})})]})}}})];function oo(e,t=[]){return a({name:"skosConcept",title:"Concept",type:"document",icon:x,initialValue:async(t,n)=>{if(e)return{baseIri:e,broader:[],related:[]};const{getClient:r}=n;return{baseIri:await r({apiVersion:"2021-03-25"}).fetch("\n *[(_type == 'skosConcept' || _type == 'skosConceptScheme') && defined(baseIri)]| order(_createdAt desc)[0].baseIri\n ")??void 0,broader:[],related:[]}},fields:[i({name:"prefLabel",title:"Preferred Label",type:"string",description:"The preferred lexical label for this concept.",validation:e=>e.required().custom(((e,t)=>{const{getClient:n}=t;return n({apiVersion:"2022-12-14"}).fetch(`*[_type == "skosConcept" && prefLabel == "${e}" && !(_id in path("drafts.**"))][0]._id`).then((e=>!e||e===t.document?._id.replace("drafts.","")||"Preferred Label must be unique."))}))}),i({name:"definition",title:"Definition",type:"text",description:p(Wn,{children:[h("summary",{children:"A complete explanation of the intended meaning of the concept."}),p("div",{children:[p("kbd",{children:["Example: documentation",h("br",{}),'Definition: "The process of storing and retrieving information in all fields of knowledge."']}),p("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",p("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),i({name:"example",title:"Examples",type:"text",description:p(Wn,{children:[h("summary",{children:"An example of the use of the concept."}),p("div",{children:[p("kbd",{children:["Example: organizations of science and culture",h("br",{}),'Example: "academies of science, general museums, world fairs"']}),p("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",p("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),i({name:"scopeNote",title:"Scope Note",type:"text",description:p(Wn,{children:[h("summary",{children:"A brief statement on the intended meaning of this concept, especially as an indication of how the use of the concept is limited in indexing practice."}),p("div",{children:[p("kbd",{children:["Example: microwave frequencies",h("br",{}),'Scope Note: "Used for frequencies between 1Ghz and 300Ghz"']}),p("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",p("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),i({name:"altLabel",title:"Alternate Label(s)",type:"array",description:p(Wn,{children:[h("summary",{children:"Synonyms, near-synonyms, abbreviations, and acronyms to a concept."}),h("div",{children:p("p",{children:[h(S,{})," Preferred, alternative, and hidden label sets must not overlap."]})})]}),of:[{type:"string"}],validation:e=>e.unique()}),i({name:"hiddenLabel",title:"Hidden Label(s)",type:"array",description:p(Wn,{children:[h("summary",{children:"Character strings that need to be accessible to applications performing text-based indexing and search operations, but which should not be displayed to end users."}),p("div",{children:[h("p",{children:"Hidden labels may for instance be used to include misspelled variants of other lexical labels."}),p("p",{children:[h(S,{})," Preferred, alternative, and hidden label sets must not overlap."]})]})]}),of:[{type:"string"}],validation:e=>e.unique()}),...ro,i({name:"conceptId",title:"Identifier",description:"This concept does not yet have a unique identifier.",type:"string",initialValue:()=>`${k(6)}`,hidden:({document:e})=>!!e?.conceptId,readOnly:({document:e})=>!!e?.conceptId,components:{input:ar}}),i({name:"broader",title:"Broader Concept(s)",description:p(Wn,{children:[h("summary",{children:"Create hierarchy between concepts, for example to create category/subcategory, part/whole, or class/instance relationships."}),h("div",{children:h("p",{children:"Broader and Associated relationships are mutually exclusive."})})]}),type:"array",of:[{type:"reference",to:{type:"skosConcept"},options:{filter:({document:e})=>({filter:'!(_id in $broader || _id in $related || _id in path("drafts.**") || _id == $self)',params:{self:e._id.replace("drafts.",""),broader:e.broader.map((({_ref:e})=>e)),related:e.related.map((({_ref:e})=>e))}})}}]}),i({name:"related",title:"Related Concept(s)",description:p(Wn,{children:[h("summary",{children:'Indicate that two concepts are inherently "related", but that one is not in any way more general than the other.'}),h("div",{children:h("p",{children:"Broader and Associated relationships are mutually exclusive."})})]}),type:"array",of:[{type:"reference",to:[{type:"skosConcept"}]}]}),...t,i({name:"historyNote",title:"History Notes",type:"text",description:p(Wn,{children:[h("summary",{children:"Significant changes to the meaning of the form of this concept."}),p("div",{children:[p("kbd",{children:["Example: person with disabilities",h("br",{}),'History Note: "Estab. 1992; heading was: handicapped [1884 - 1992]."']}),p("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",p("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),i({name:"editorialNote",title:"Editorial Notes",type:"text",description:p(Wn,{children:[h("summary",{children:"Information to aid in administrative housekeeping, such as reminders of editorial work still to be done, or warnings in the event that future editorial changes might be made."}),p("div",{children:[p("kbd",{children:["Example: doubleclick",h("br",{}),'Editorial Note: "Review this term after the company merger is complete."']}),p("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",p("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3}),i({name:"changeNote",title:"Change Notes",type:"text",description:p(Wn,{children:[h("summary",{children:"Fine-grained changes to a concept, for the purposes of administration and maintenance."}),p("div",{children:[p("kbd",{children:["Example: tomato",h("br",{}),"Change Note: \"Moved from under 'fruits' to under 'vegetables' by Horace Gray\""]}),p("p",{children:["For more information on the recommended usage of the SKOS documentation properties, see",p("a",{href:"https://www.w3.org/TR/2009/NOTE-skos-primer-20090818/#secdocumentation",target:"_blank",rel:"noreferrer",children:[" ","W3C SKOS Primer: 2.4 Documentary Notes"]})]})]})]}),rows:3})],orderings:[{title:"Top Concepts",name:"topConcept",by:[{field:"topConcept",direction:"desc"},{field:"prefLabel",direction:"asc"}]},{title:"Preferred Label",name:"prefLabel",by:[{field:"prefLabel",direction:"asc"}]}],preview:{select:{title:"prefLabel"},prepare:({title:e})=>({title:e,media:I})}})}function io(){return h("svg",{"data-sanity-icon":!0,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h("path",{d:"M5.5 6.5V5.9H4.9V6.5H5.5ZM11.5 6.5H12.1V5.9H11.5V6.5ZM5.5 9H4.9V9.6H5.5V9ZM11.5 9V9.6H12.1V9H11.5ZM13.5 11V10.4H12.9V11H13.5ZM19.5 11H20.1V10.4H19.5V11ZM13.5 13.5H12.9V14.1H13.5V13.5ZM19.5 13.5V14.1H20.1V13.5H19.5ZM13.5 16V15.4H12.9V16H13.5ZM19.5 16H20.1V15.4H19.5V16ZM13.5 18.5H12.9V19.1H13.5V18.5ZM19.5 18.5V19.1H20.1V18.5H19.5ZM5.5 7.1H11.5V5.9H5.5V7.1ZM6.1 9V6.5H4.9V9H6.1ZM11.5 8.4H5.5V9.6H11.5V8.4ZM10.9 6.5V9H12.1V6.5H10.9ZM13.5 11.6H19.5V10.4H13.5V11.6ZM14.1 13.5V11H12.9V13.5H14.1ZM19.5 12.9H13.5V14.1H19.5V12.9ZM18.9 11V13.5H20.1V11H18.9ZM13.5 16.6H19.5V15.4H13.5V16.6ZM14.1 18.5V16H12.9V18.5H14.1ZM19.5 17.9H13.5V19.1H19.5V17.9ZM18.9 16V18.5H20.1V16H18.9ZM8 17.85H13.5V16.65H8V17.85ZM8 12.85H13.5V11.65H8V12.85ZM7.9 9.5V17.85H9.1V9.5H7.9Z",fill:"currentColor"})})}function ao(e,t=[]){return a({name:"skosConceptScheme",title:"Concept Scheme",type:"document",icon:io,initialValue:async(t,n)=>{if(e)return{baseIri:e};const{getClient:r}=n;return{baseIri:await r({apiVersion:"2021-03-25"}).fetch("\n *[(_type == 'skosConcept' || _type == 'skosConceptScheme') && defined(baseIri)]| order(_createdAt desc)[0].baseIri\n ")??void 0}},fields:[i({name:"title",title:"Title",type:"string",description:"Taxonomy schemes group concepts into defined sets, such as thesauri, classification schemes, or facets. Concepts may belong on many (or no) concept schemes, and you may create as many (or few) concept schemes as you like"}),i({name:"description",title:"Description",type:"text",rows:5,description:"Describe the intended use of this scheme."}),i({name:"controls",title:"Concept Management Controls",deprecated:{reason:"This field was used for a previous version of the plugin and is no longer needed. Remove the value to hide this field."},type:"boolean",readOnly:!0,hidden:({document:e})=>void 0===e?.controls,components:{input:no}}),...ro,i({name:"schemeId",title:"Identifier",description:"This scheme does not yet have a unique identifier.",type:"string",initialValue:()=>`${k(6)}`,hidden:({document:e})=>!!e?.schemeId,readOnly:({document:e})=>!!e?.schemeId,components:{input:ar}}),i({name:"topConcepts",title:"Top Concepts",type:"array",validation:e=>e.unique(),of:[s({type:"reference",to:[{type:"skosConcept"}]})],options:{sortable:!1}}),i({name:"concepts",title:"Concepts",type:"array",validation:e=>e.unique(),of:[s({type:"reference",to:[{type:"skosConcept"}]})],options:{sortable:!1}}),...t],preview:{select:{title:"title"},prepare:({title:e})=>({title:e,media:io})}})}function so(e){const{schemeId:t}=e||{};return{filter:'!(_id in path("drafts.**"))\n && _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].concepts[]._ref\n || _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].topConcepts[]._ref',params:{schemeId:t}}}function co(e){const{schemeId:t,branchId:n}=e||{};return{filter:'!(_id in path("drafts.**")) && _id in *[_type=="skosConceptScheme" && schemeId == $schemeId].concepts[]._ref \n && $branchId in broader[]->conceptId\n || $branchId in broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->conceptId\n || $branchId in broader[]->broader[]->broader[]->broader[]->broader[]->conceptId',params:{schemeId:t,branchId:n}}}const lo=e=>e.list().title("Taxonomy Manager").items([e.documentTypeListItem("skosConceptScheme").title("Concept Schemes"),e.documentTypeListItem("skosConcept").title("Concepts")]),po=(e,{schemaType:t})=>{switch(t){case"skosConceptScheme":return e.document().views([e.view.component(eo).title("Tree View").icon(io),e.view.form().icon(_)]);case"skosConcept":return e.document().views([e.view.form().icon(_)]);default:e.view.form()}},ho=c((e=>{const{baseUri:t,customConceptFields:n,customSchemeFields:r}=e||{};return{name:"taxonomyManager",options:e,schema:{types:[oo(t,n),ao(t,r)]},plugins:[d({name:"taxonomy",title:"Taxonomy",structure:lo,defaultDocumentNode:po,icon:io})]}}));export{to as HierarchyInput,eo as TreeView,co as branchFilter,so as schemeFilter,ho as taxonomyManager};//# sourceMappingURL=index.esm.esm.js.map