1/*! licenses: /vendor.LICENSE.txt */ 2var B=Object.defineProperty;var H=(t,s,n)=>s in t?B(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var h=(t,s,n)=>H(t,typeof s!="symbol"?s+"":s,n);import{l as w,aw as G,bR as M,bd as v,a8 as l,at as k,N as A,cy as V,dn as W,ci as q,U as F,c as U,c2 as I,c1 as R}from"./main-CbQlDdW6.js";import{r as x,n as K,o as Q}from"./vendor-6DxLhnrV.js";import{b_ as z,b$ as $,bS as C,bR as Y,t as J,C as N,c as X,N as y,dU as D,a as Z,b as ee,e as se,q as P,dM as te,bw as ne,D as ae,y as ie,j as re,L as oe,P as ce,H as le,aS as de,T as pe}from"./startReactApp-CQcauHYg.js";import{j as e,e as he,v as E}from"./echoes-qrJd0a4U.js";import{b as me,f as ue}from"./web-api-ByQ7V-ju.js";import{T as xe}from"./Tabs-voSmXqw9.js";import{S as we}from"./SubnavigationItem-BZlL4GjW.js";import"./lodash-CbJiKz-E.js";import"./datefns-BO8xBBw8.js";import"./highlightjs-DooahNbT.js";import"./tabs-DAdhA6au.js";function O(t,s,n){const a=t.search.toLowerCase();return(t.internal||!n.internal)&&(t.deprecated||!n.deprecatedSince)&&(S(s.path,n.key).includes(a)||(n.description||"").toLowerCase().includes(a))}function S(t,s){return t+"/"+s}const _=(t,s)=>{const n=t.split("/"),a=s.split("/");if(n.length>a.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==a[r])return!1;return!0},f=w.memoize(t=>({search:Y(t.query),deprecated:C(t.deprecated)||!1,internal:C(t.internal)||!1})),g=w.memoize(t=>z({query:t.search?$(t.search):void 0,deprecated:t.deprecated||void 0,internal:t.internal||void 0}));function je(t){const s=/(\d{1,5})\.(\d{1,5})/.exec(t);if(s)return{major:Number(s[1]),minor:Number(s[2])}}function fe({changelog:t}){return e.jsx(G,{"data-component":"action-changelog",children:t.map((s,n)=>e.jsxs(M,{children:[e.jsx(v,{className:"sw-mr-2",variant:"default",children:s.version}),s.description]},n))})}function j({since:t}){const{formatMessage:s}=he(),n=t?s({id:"api_documentation.deprecated_since_x"},{since:t}):s({id:"api_documentation.deprecated"});return e.jsx(v,{variant:"default","data-component":"deprecated-badge",children:n})}function b(){return e.jsx(J,{content:l("api_documentation.internal_tooltip"),"data-component":"internal-badge",children:e.jsx("span",{children:e.jsx(v,{variant:"deleted",children:l("internal")})})})}const L=["200","auto","200"];class ge extends x.PureComponent{renderKey(s){return e.jsx(N,{children:e.jsxs("div",{children:[e.jsx(X,{children:e.jsx("code",{className:"sw-code",children:s.key})}),s.internal&&e.jsx("div",{className:"sw-mt-1",children:e.jsx(b,{})}),s.deprecatedSince&&e.jsx("div",{className:"sw-mt-1",children:e.jsx(j,{since:s.deprecatedSince})}),e.jsx(y,{as:"div",className:"sw-mt-1",children:s.required?"required":"optional"}),s.since&&e.jsx(y,{as:"div",className:"sw-mt-1",children:k("since_x",s.since)}),this.props.showDeprecated&&s.deprecatedKey&&e.jsxs("div",{className:"sw-ml-2 sw-mt-4",children:[e.jsxs(y,{as:"div",className:"sw-mb-1",children:[l("replaces"),":"]}),e.jsx("code",{className:"sw-code",children:s.deprecatedKey}),s.deprecatedKeySince&&e.jsx("div",{className:"sw-mt-1",children:e.jsx(j,{since:s.deprecatedKeySince})})]})]})})}renderConstraint(s,n,a){const r=s[n];return r!==void 0?e.jsxs("div",{className:"sw-mt-1",children:[e.jsx(D,{as:"div",children:l("api_documentation",a)}),e.jsx("code",{className:"sw-code",children:r})]}):null}render(){const{params:s,showDeprecated:n,showInternal:a}=this.props,r=s.filter(i=>n||!i.deprecatedSince).filter(i=>a||!i.internal);return e.jsx("div",{className:"sw-mt-6","data-component":"params",children:e.jsx(Z,{columnCount:L.length,columnWidths:L,children:r.map(i=>e.jsxs(ee,{children:[this.renderKey(i),e.jsx(N,{children:e.jsx(A,{htmlAsString:i.description,children:e.jsx("div",{className:"markdown"})})}),e.jsx(N,{children:e.jsxs("div",{children:[i.possibleValues&&e.jsxs("div",{children:[e.jsx(D,{as:"div",children:l("api_documentation.possible_values")}),e.jsx("ul",{children:i.possibleValues.map(o=>e.jsx("li",{className:"sw-mt-1",children:e.jsx("code",{children:o})},o))})]}),this.renderConstraint(i,"defaultValue","default_values"),this.renderConstraint(i,"exampleValue","example_values"),this.renderConstraint(i,"maxValuesAllowed","max_values"),this.renderConstraint(i,"minimumValue","min_value"),this.renderConstraint(i,"maximumValue","max_value"),this.renderConstraint(i,"minimumLength","min_length"),this.renderConstraint(i,"maximumLength","max_length")]})})]},i.key))})})}}class ve extends x.PureComponent{constructor(){super(...arguments);h(this,"mounted",!1);h(this,"state",{})}
2componentDidMount(){this.mounted=!0,this.fetchResponseExample()}componentDidUpdate(n){n.action!==this.props.action&&this.fetchResponseExample()}componentWillUnmount(){this.mounted=!1}fetchResponseExample(){const{domain:n,action:a}=this.props;me(n.path,a.key).then(r=>this.setState({responseExample:r}),()=>{})}render(){const{responseExample:n}=this.state;return e.jsx("div",{className:"sw-mt-6","data-component":"response-example",children:n&&e.jsx("pre",{className:"sw-code sw-whitespace-pre-wrap",children:n.example})})}}var u=function(t){return t.PARAMS="parameters",t.RESPONSE="response_example",t.CHANGELOG="changelog",t}(u||{});function Se(t){const{action:s,domain:n,showDeprecated:a,showInternal:r}=t,i=s.post?"POST":"GET",o=S(n.path,s.key),[d,c]=x.useState(void 0),m=x.useMemo(()=>{const p=[];return s.params&&p.push(u.PARAMS),s.hasResponseExample&&p.push(u.RESPONSE),s.changelog.length>0&&p.push(u.CHANGELOG),p.map(T=>({label:l("api_documentation",T),value:T}))},[s]);return e.jsxs(se,{id:o,"data-component":"action",children:[e.jsxs("header",{className:"sw-flex sw-items-baseline sw-gap-2",children:[e.jsx(V,{to:{pathname:"/web_api/"+o,search:P(g({deprecated:!!s.deprecatedSince,internal:!!s.internal}))},children:e.jsx(W,{})}),e.jsxs(te,{className:"sw-m-0",children:[i," ",o]}),s.internal&&e.jsx(b,{}),s.since&&e.jsx(v,{variant:"new",children:k("since_x",s.since)}),s.deprecatedSince&&e.jsx(j,{since:s.deprecatedSince})]}),e.jsx(A,{htmlAsString:s.description,children:e.jsx("div",{className:"sw-mt-4 markdown"})}),e.jsxs("div",{className:"sw-mt-4",children:[e.jsx(xe,{onChange:p=>c(p),options:m,value:d}),d===u.PARAMS&&s.params&&e.jsx(ge,{params:s.params,showDeprecated:a,showInternal:r}),d===u.RESPONSE&&s.hasResponseExample&&e.jsx(ve,{action:s,domain:n}),d===u.CHANGELOG&&e.jsx(fe,{changelog:s.changelog})]})]})}function be({domain:t,query:s}){const n=t.actions.filter(a=>O(s,t,a));return e.jsxs("div",{"data-component":"domain",children:[e.jsxs("header",{className:"sw-flex sw-items-baseline sw-gap-3",children:[e.jsx(ne,{className:"sw-m-0",children:t.path}),!w.isEmpty(t.deprecatedSince)&&e.jsx(j,{since:t.deprecatedSince}),t.internal&&e.jsx(b,{})]}),!w.isEmpty(t.description)&&e.jsx(A,{htmlAsString:t.description,children:e.jsx("div",{className:"sw-mt-3 markdown"})}),e.jsx("div",{className:"sw-mt-4 sw-flex sw-flex-col sw-gap-4",children:n.map(a=>e.jsx(Se,{action:a,domain:t,showDeprecated:s.deprecated,showInternal:s.internal},S(t.path,a.key)))})]})}function Ne(t){const{domains:s,query:n,splat:a}=t,r=K(),i=x.useCallback(c=>{r({pathname:"/web_api/"+c,search:P(g(n))})},[n,r]),o=(s||[]).map(c=>{const m=c.actions.filter(p=>O(n,c,p));return{...c,filteredActions:m}}).filter(c=>c.filteredActions.length),d=c=>{const m=!c.actions.find(p=>!p.internal);return e.jsxs(we,{active:_(c.path,a),onClick:()=>i(c.path),"data-component":"render-domain",children:[c.path,c.deprecatedSince&&e.jsx(j,{since:c.deprecatedSince}),m&&e.jsx(b,{})]},c.path)};return e.jsx(q,{className:"sw-mt-4 sw-box-border","data-component":"menu",children:o.map(d)})}function ye(t){const{query:s,onToggleInternal:n,onToggleDeprecated:a}=t;return e.jsxs("div",{"data-component":"search",children:[e.jsx("div",{children:e.jsx(F,{onChange:t.onSearch,placeholder:l("api_documentation.search"),value:s.search})}),e.jsx("div",{className:"sw-mt-4 sw-px-1 sw-max-w-[18rem]",children:e.jsx(E,{checked:s.internal,helpText:l("api_documentation.internal_tooltip"),label:l("api_documentation.show_internal"),onCheck:n})}),e.jsx("div",{className:"sw-flex sw-px-1 sw-items-center sw-mt-2 sw-gap-2",children:e.jsx(E,{checked:s.deprecated,helpText:e.jsx(ae,{shouldOpenInNewTab:!0,to:ie.DeprecatedFeatures,children:l("api_documentation.show_deprecated.learn_more")}),label:l("api_documentation.show_deprecated"),onCheck:a})})]})}class _e extends x.PureComponent{constructor(){super(...arguments);h(this,"mounted",!1);h(this,"state",{domains:[]});h(this,"scrollToAction",()=>{const n=this.props.params.splat||"",a=document.getElementById(n);a==null||a.scrollIntoView({block:"center"})});h(this,"updateQuery",n=>{const a=g({...f(this.props.location.query),...n});this.props.router.push({pathname:this.props.location.pathname,query:a})});h(this,"handleSearch",n=>{this.updateQuery({search:n})});h(this,"handleToggleInternal",()=>{this.toggleFlag("internal","internal")});h(this,"handleToggleDeprecated",()=>{this.toggleFlag("deprecated","deprecatedSince")})}componentDidMount(){this.mounted=!0,this.fetchList()}componentDidUpdate(){this.enforceFlags(),this.scrollToAction()}componentWillUnmount(){this.mounted=!1}fetchList(){ue().then(n=>{this.mounted&&this.setState({domains:this.parseDomains(n)})},()=>{})}parseDomains(n){return n.map(a=>{const r=Te(a),i=!a.actions.find(o=>!o.internal);return{...a,deprecatedSince:r==null?void 0:r.deprecatedSince,internal:i}})}enforceFlags(){const n=this.props.params.splat||"",{domains:a}=this.state,r=f(this.props.location.query),i=a.find(o=>n.startsWith(o.path));if(i){const o=i.actions.find(m=>S(i.path,m.key)===n),d=!!(!r.internal&&(i.internal||o!=null&&o.internal)),c=!!(!r.deprecated&&(i.deprecatedSince||o!=null&&o.deprecatedSince));(d||c)&&this.updateQuery({internal:d,deprecated:c})}}toggleFlag(n,a){const r=this.props.params.splat||"",{domains:i}=this.state,o=i.find(m=>_(m.path,r)),d=f(this.props.location.query),c=!d[n];o!=null&&o[a]&&!c?this.props.router.push({pathname:"/web_api",query:g({...d,[n]:!1})}):this.updateQuery({[n]:c})}render(){const n=this.props.params.splat??"",a=f(this.props.location.query),{domains:r}=this.state,i=r.find(o=>_(o.path,n));return e.jsx(oe,{"data-component":"web-api-app",children:e.jsxs(ce,{className:"sw-typo-default sw-w-full sw-flex",children:[e.jsx(le,{defer:!1,title:l("api_documentation.page")}),e.jsxs("div",{className:"sw-w-full sw-flex",children:[e.jsxs(Ce,{"aria-label":l("api_documentation.domain_nav"),className:"sw--mx-2",children:[e.jsx(de,{anchor:"webapi_main"}),e.jsx(pe,{children:l("api_documentation.page")}),e.jsx(ye,{onSearch:this.handleSearch,onToggleDeprecated:this.handleToggleDeprecated,onToggleInternal:this.handleToggleInternal,query:a}),e.jsx("div",{className:"sw-w-[300px] sw-mr-2",children:e.jsx(Ne,{domains:this.state.domains,query:a,splat:n})})]}),e.jsx("main",{className:"sw-box-border sw-overflow-y-auto sw-relative sw-flex-1 sw-min-w-0 sw-ml-8 sw-py-8",style:{height:`calc(100vh - ${I+R}px`},children:i&&e.jsx(be,{domain:i,query:a},i.path)})]})]})})}}function Ae(t){const s=Q();return e.jsx(_e,{...t,params:{splat:s["*"]},"data-component":"web-api-app-with-params"})}const Ve=re(Ae);function Te(t){const s={major:0,minor:0};return t.actions.every(({deprecatedSince:r})=>r!==void 0)&&w.maxBy(t.actions,r=>{const i=r.deprecatedSince&&je(r.deprecatedSince)||s;return i.major*1024+i.minor})||void 0}const Ce=U("nav",{target:"e1tkkm570"})("scrollbar-gutter:stable;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;height:calc(100vh - ",I+R,"px);padding-top:1.5rem;padding-bottom:1.5rem;");export{_e as WebApiApp,Ve as default}; 3//# sourceMappingURL=WebApiApp-CqZxix4K.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.