text: (window.webpackJsonp=window.webpackJsonp||[]).push([[77],{131:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return l})),t.d(n,"rightToc",(function(){return p})),t.d(n,"default",(function(){return m}));var a=t(2),i=t(6),r=(t(0),t(142)),o=(t(144),t(149)),c=t(150),b={id:"configuration",title:"4.1 \u914d\u7f6e",sidebar_label:"4.1 \u914d\u7f6e"},l={unversionedId:"configuration",id:"configuration",isDocsHomePage:!1,title:"4.1 \u914d\u7f6e",description:"\u63a8\u8350\u4f7f\u7528 \u300a4.2 \u9009\u9879\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002\uff08\u4e3a\u4ec0\u4e48\uff09\uff1f",source:"@site/docs\\configuration.mdx",slug:"/configuration",permalink:"/docs/configuration",editUrl:"https://gitee.com/monksoul/Fur/tree/main/handbook/docs/configuration.mdx",version:"current",sidebar_label:"4.1 \u914d\u7f6e",sidebar:"docs",previous:{title:"3. \u5e94\u7528\u542f\u52a8",permalink:"/docs/appstartup"},next:{title:"4.2 \u9009\u9879",permalink:"/docs/options"}},p=[{value:"4.1.1 \u4ec0\u4e48\u662f\u914d\u7f6e",id:"411-\u4ec0\u4e48\u662f\u914d\u7f6e",children:[]},{value:"4.1.2 \u914d\u7f6e\u7684\u4f7f\u7528",id:"412-\u914d\u7f6e\u7684\u4f7f\u7528",children:[{value:"4.1.2.1 \u914d\u7f6e <code>appsettings.json</code> \u4fe1\u606f",id:"4121-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.1.2.2 \u8bfb\u53d6 <code>appsettings.json</code> \u4fe1\u606f",id:"4122-\u8bfb\u53d6-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.1.2.3 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",id:"4123-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",children:[]}]},{value:"4.1.3 <code>\u8def\u5f84\u7b26</code> \u67e5\u627e\u8282\u70b9",id:"413-\u8def\u5f84\u7b26-\u67e5\u627e\u8282\u70b9",children:[]},{value:"4.1.4 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6",id:"414-\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6",children:[{value:"4.1.4.1 \u8bfb\u53d6 <code>emailsetting.json</code> \u914d\u7f6e",id:"4141-\u8bfb\u53d6-emailsettingjson-\u914d\u7f6e",children:[]}]},{value:"4.1.5 \u4e0d\u540c\u73af\u5883\u8bfb\u53d6",id:"415-\u4e0d\u540c\u73af\u5883\u8bfb\u53d6",children:[]},{value:"4.1.6 \u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08<code>\u70ed\u66f4\u65b0</code>\uff09",id:"416-\u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",children:[]},{value:"4.1.7 \u914d\u7f6e\u7684\u4f18\u7f3a\u70b9",id:"417-\u914d\u7f6e\u7684\u4f18\u7f3a\u70b9",children:[]},{value:"4.1.8 \u914d\u7f6e\u4f7f\u7528\u573a\u666f",id:"418-\u914d\u7f6e\u4f7f\u7528\u573a\u666f",children:[]},{value:"4.1.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"419-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={rightToc:p};function m(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/options"}),"4.2 \u9009\u9879"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002\uff08",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"#417-%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BC%98%E7%BC%BA%E7%82%B9"}),"\u4e3a\u4ec0\u4e48"),"\uff09\uff1f"))),Object(r.b)("h2",{id:"411-\u4ec0\u4e48\u662f\u914d\u7f6e"},"4.1.1 \u4ec0\u4e48\u662f\u914d\u7f6e"),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u914d\u7f6e\u5c06\u7cfb\u7edf\u5e94\u7528\u53ef\u52a8\u6001\u8c03\u914d\u7684\u9009\u9879\u653e\u5728\u7edf\u4e00\u5730\u65b9\u7ba1\u7406\uff0c\u901a\u8fc7\u4e0d\u540c\u7684\u914d\u7f6e\u8ba9\u7cfb\u7edf\u505a\u51fa\u52a8\u6001\u8c03\u6574\u3002"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u65f6\u9ed8\u8ba4\u52a0\u8f7d ",Object(r.b)("inlineCode",{parentName:"p"},"\u542f\u52a8\u9879\u76ee")," \u4e0b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4f5c\u4e3a\u5e94\u7528\u914d\u7f6e\u3002\u540c\u65f6\u8fd8\u652f\u6301",Object(r.b)("strong",{parentName:"p"},"\u4e0d\u540c\u7684\u8fd0\u884c\u73af\u5883"),"\u52a0\u8f7d\u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Development"),"\uff1a\u52a0\u8f7d ",Object(r.b)("inlineCode",{parentName:"li"},"appsettings.Development.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Staging"),"\uff1a\u52a0\u8f7d ",Object(r.b)("inlineCode",{parentName:"li"},"appsettings.Staging.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"{Environment}"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"appsettings.{Environment}.json"))),Object(r.b)("h2",{id:"412-\u914d\u7f6e\u7684\u4f7f\u7528"},"4.1.2 \u914d\u7f6e\u7684\u4f7f\u7528"),Object(r.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u83b7\u53d6",Object(r.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u540d\u79f0\u3001\u7248\u672c\u53f7\u53ca\u7248\u6743\u4fe1\u606f"),"\uff0c\u8fd9\u4e9b\u4fe1\u606f\u53ef\u80fd\u968f\u65f6\u53d8\u5316\u800c\u4e14\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u5c06\u8fd9\u4e9b\u4fe1\u606f\u914d\u7f6e\u8d77\u6765\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(r.b)("h3",{id:"4121-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f"},"4.1.2.1 \u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2-6}","{2-6}":!0}),'{\n  "AppInfo": {\n    "Name": "Fur",\n    "Version": "1.0.0",\n    "Company": "Baiqian"\n  }\n}\n')),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u590d\u5236\u8f93\u51fa\u76ee\u5f55\u4e3a",Object(r.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"))),Object(r.b)("h3",{id:"4122-\u8bfb\u53d6-appsettingsjson-\u4fe1\u606f"},"4.1.2.2 \u8bfb\u53d6 ",Object(r.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u8bfb\u53d6\u65b9\u5f0f\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u4f9d\u8d56\u6ce8\u5165 ",Object(r.b)("inlineCode",{parentName:"li"},"IConfiguration")," \u5bf9\u8c61\u8bfb\u53d6"),Object(r.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"li"},"App.Configuration[jsonKey]")," \u8bfb\u53d6")),Object(r.b)(o.a,{defaultValue:"App.Configuration[jsonKey]",values:[{label:"App.Configuration[jsonKey]",value:"App.Configuration[jsonKey]"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"}],mdxType:"Tabs"},Object(r.b)(c.a,{value:"App.Configuration[jsonKey]",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11-13}","{11-13}":!0}),'using Microsoft.AspNetCore.Mvc;\n\nnamespace Fur.Web.Entry.Controllers\n{\n    [Route("api/[controller]")]\n    public class DefaultController : ControllerBase\n    {\n        [HttpGet]\n        public string Get()\n        {\n            return $@"\u540d\u79f0\uff1a{App.Configuration["AppInfo:Name"]}\uff0c\n                      \u7248\u672c\uff1a{App.Configuration["AppInfo:Version"]}\uff0c\n                      \u516c\u53f8\uff1a{App.Configuration["AppInfo:Company"]}";\n        }\n    }\n}\n'))),Object(r.b)(c.a,{value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,10-15}","{2,10-15}":!0}),'using Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Configuration;\n\nnamespace Fur.Web.Entry.Controllers\n{\n    [Route("api/[controller]")]\n    public class DefaultController : ControllerBase\n    {\n        [HttpGet]\n        public string Get([FromServices] IConfiguration configuration)\n        {\n            return $@"\u540d\u79f0\uff1a{configuration["AppInfo:Name"]}\uff0c\n                      \u7248\u672c\uff1a{configuration["AppInfo:Version"]}\uff0c\n                      \u516c\u53f8\uff1a{configuration["AppInfo:Company"]}";\n        }\n    }\n}\n')))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165\u6ce8\u5165\u5b9e\u4f8b\u6709\u51e0\u79cd\u65b9\u5f0f\uff1a"),Object(r.b)("ul",{parentName:"div"},Object(r.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u6ce8\u5165\u65b9\u5f0f")),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),"private readonly IConfiguration _configuration;\npublic DefaultController(IConfiguration configuration)\n{\n    _configuration = configuration;\n}\n")),Object(r.b)("ul",{parentName:"div"},Object(r.b)("li",{parentName:"ul"},"\u53c2\u6570\u6ce8\u5165\u65b9\u5f0f ",Object(r.b)("inlineCode",{parentName:"li"},"[FromServices]"))),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public string Get([FromServices] IConfiguration configuration)\n{\n}\n")),Object(r.b)("ul",{parentName:"div"},Object(r.b)("li",{parentName:"ul"},"\u5c5e\u6027\u6ce8\u5165\u65b9\u5f0f")),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public IConfiguration Configuration { get; set; }\n")),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u300a",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.1"}),"ASP.NET Core - \u4f9d\u8d56\u6ce8\u5165"),"\u300b \u77e5\u8bc6"))),Object(r.b)("h3",{id:"4123-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"},"4.1.2.3 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u5728\u53ef\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u4f9d\u8d56\u6ce8\u5165 ",Object(r.b)("inlineCode",{parentName:"li"},"IConfiguration")," \u8bfb\u53d6"),Object(r.b)("li",{parentName:"ul"},"\u5728\u9759\u6001\u7c7b/\u975e\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u9009\u62e9 ",Object(r.b)("inlineCode",{parentName:"li"},"App.Configuration[jsonKey]")," \u8bfb\u53d6")),Object(r.b)("h2",{id:"413-\u8def\u5f84\u7b26-\u67e5\u627e\u8282\u70b9"},"4.1.3 ",Object(r.b)("inlineCode",{parentName:"h2"},"\u8def\u5f84\u7b26")," \u67e5\u627e\u8282\u70b9"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u914d\u7f6e\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},":")," \u5206\u9694\u7b26\u6765\u8bfb\u53d6\u5206\u5c42\u914d\u7f6e\u6570\u636e\u3002\u5982\u4e0a\u8ff0\u4f8b\u5b50\u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"AppInfo:Name"),"\u3002\u5982\u6709\u66f4\u591a\u5c42\u7ea7\u6570\u636e\u5219\u53ea\u9700\u8981\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},":")," \u8fdb\u5165\u4e0b\u4e00\u5c42\u8282\u70b9\u5373\u53ef\u3002"),Object(r.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b\u914d\u7f6e\u4fe1\u606f\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{5-12}","{5-12}":!0}),'{\n  "AppInfo": {\n    "Name": "Fur",\n    "Version": "1.0.0",\n    "Company": {\n      "Name": "Baiqian",\n      "Address": {\n        "City": "\u4e2d\u56fd",\n        "Province": "\u5e7f\u4e1c\u7701",\n        "Detail": "\u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8"\n      }\n    }\n  }\n}\n')),Object(r.b)(o.a,{defaultValue:"two",values:[{label:"\u8bfb\u53d6\u7b2c\u4e8c\u5c42",value:"two"},{label:"\u8bfb\u53d6\u7b2c\u4e09\u5c42",value:"three"},{label:"\u8bfb\u53d6\u7b2c\u56db\u5c42",value:"four"},{label:"\u8bfb\u53d6\u7b2cN\u5c42",value:"n"}],mdxType:"Tabs"},Object(r.b)(c.a,{value:"two",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Name"]; // => Fur\n'))),Object(r.b)(c.a,{value:"three",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Company:Name"]; // => Baiqian\n'))),Object(r.b)(c.a,{value:"four",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Company:Address:Detail"]; // => \u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8\n'))),Object(r.b)(c.a,{value:"n",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Tier2:Tier3:Tier4...Tiern1:Tiern3..."]; // => \u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8\n')))),Object(r.b)("h2",{id:"414-\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6"},"4.1.4 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6"),Object(r.b)("p",null,"\u5927\u591a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u7684\u914d\u7f6e\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u4f46\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5e0c\u671b\u67d0\u4e9b\u7ec4\u4ef6\u6216\u529f\u80fd\u62e5\u6709\u72ec\u7acb\u7684\u914d\u7f6e\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u7528\u5230\u81ea\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u76ee\u524d\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},".xml")," \u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-13} title="Fur.Web.Entry/emailsetting.json"',"{2-13}":!0,title:'"Fur.Web.Entry/emailsetting.json"'}),'{\n  "outlook": {\n    "smtp": {\n      "server": "smtp.office365.com",\n      "port": "587",\n      "ssl": "STARTTLS"\n    },\n    "pop": {\n      "server": "outlook.office365.com",\n      "port": "995",\n      "ssl": "TLS"\n    }\n  }\n}\n')),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-xml"}),'<?xml version="1.0" encoding="utf-8" ?>\n<configuration>\n  <MyKey>MyXMLFile Value</MyKey>\n  <Position>\n    <Title>Title from  MyXMLFile</Title>\n    <Name>Name from MyXMLFile</Name>\n  </Position>\n  <Logging>\n    <LogLevel>\n      <Default>Information</Default>\n      <Microsoft>Warning</Microsoft>\n    </LogLevel>\n  </Logging>\n</configuration>\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"xml \u914d\u7f6e\u4e8b\u9879")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"xml")," \u914d\u7f6e\uff0c\u90a3\u4e48\u6587\u4ef6\u540d\u5fc5\u987b\u4ee5 ",Object(r.b)("inlineCode",{parentName:"p"},".config.xml")," \u7ed3\u5c3e\uff08\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\u3002"))),Object(r.b)("p",null,"\u540c\u65f6 ",Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u65b9\u5f0f\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u8bfb\u53d6\uff0c\u5982\uff1a"),Object(r.b)("h3",{id:"4141-\u8bfb\u53d6-emailsettingjson-\u914d\u7f6e"},"4.1.4.1 \u8bfb\u53d6 ",Object(r.b)("inlineCode",{parentName:"h3"},"emailsetting.json")," \u914d\u7f6e"),Object(r.b)("p",null,"\u8bfb\u53d6\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u548c\u8bfb\u53d6 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e00\u81f4\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4ece\u591a\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u8f93\u5165\uff0c\u5982\uff1a"),Object(r.b)(o.a,{defaultValue:"jtl",values:[{label:"App.Configuration[jsonKey]",value:"jtl"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"ylzr"}],mdxType:"Tabs"},Object(r.b)(c.a,{value:"jtl",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var smtpServer = App.Configuration["outlook:smtp:server"]; // => smtp.office365.com\n'))),Object(r.b)(c.a,{value:"ylzr",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var smtpServer = _configuration["outlook:smtp:server"]; // => smtp.office365.com\n')))),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Fur")," \u6846\u67b6\u4f1a\u5728\u542f\u52a8\u65f6\u81ea\u52a8\u626b\u63cf\u6bcf\u4e00\u4e2a\u9879\u76ee\u5c42\u6839\u76ee\u5f55\u4e0b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"*.xml")," \u6587\u4ef6\u52a0\u5165\u914d\u7f6e\u4e2d\uff0c\u6240\u4ee5\u65e0\u9700\u624b\u5de5\u914d\u7f6e\u3002\u65b0\u589e",Object(r.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"*.xml")," \u6587\u4ef6\u7684\u5c5e\u6027",Object(r.b)("inlineCode",{parentName:"p"},"\u590d\u5236\u5230\u8f93\u51fa\u76ee\u5f55"),"\u8bbe\u7f6e\u4e3a\u59cb\u7ec8\u590d\u5236\uff0c\u5426\u5219\u4f1a\u626b\u63cf\u4e0d\u5230\u3002"),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u5e93")," \u9879\u76ee\u4e2d\uff0c\u4e0d\u80fd\u8d77\u540d\u548c ",Object(r.b)("inlineCode",{parentName:"p"},"\u542f\u52a8\u9879\u76ee")," \u4e00\u6837\u7684\u914d\u7f6e\u6587\u4ef6\u540d\uff0c\u4e0d\u7136\u4f1a\u76f8\u4e92\u8986\u76d6\u3002"))),Object(r.b)("h2",{id:"415-\u4e0d\u540c\u73af\u5883\u8bfb\u53d6"},"4.1.5 \u4e0d\u540c\u73af\u5883\u8bfb\u53d6"),Object(r.b)("p",null,"\u5728\u5b9e\u9645\u5e94\u7528\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u6839\u636e\u4e0d\u540c\u7684\u73af\u5883\u52a0\u8f7d\u4e0d\u540c\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32"),"\u3002"),Object(r.b)("p",null,"\u8fd9\u65f6\u6211\u4eec\u53ea\u9700\u8981\u9075\u5faa\u7279\u5b9a\u547d\u540d\u89c4\u8303 ",Object(r.b)("inlineCode",{parentName:"p"},"{name}.{Environment}.json")," \u5373\u53ef\u3002\u5982\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"appsettings.Development.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"appsettings.Staging.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"appsettings.Production.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"emailsetting.Development.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"emailsetting.Staging.json")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"emailsetting.Production.json"))),Object(r.b)("p",null,"\u8fd9\u65f6\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u81ea\u52a8\u52a0\u8f7d\u4e0d\u540c\u73af\u5883\u7684\u914d\u7f6e\u6587\u4ef6\u3002"),Object(r.b)("h2",{id:"416-\u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09"},"4.1.6 \u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08",Object(r.b)("inlineCode",{parentName:"h2"},"\u70ed\u66f4\u65b0"),"\uff09"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},".NET Core")," \u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u914d\u7f6e\u652f\u6301\u66f4\u6539\u901a\u77e5\uff0c\u4e5f\u5c31\u662f\u70ed\u66f4\u65b0\u64cd\u4f5c\u3002",Object(r.b)("strong",{parentName:"p"},"\u4e00\u65e6\u76d1\u542c\u5230 ",Object(r.b)("inlineCode",{parentName:"strong"},"appsetting.json")," \u6216\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u53d1\u751f\u53d8\u52a8\uff0c\u5c31\u4f1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"strong"},"OnChange")," \u65b9\u6cd5"),"\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,4-5}","{2,4-5}":!0}),'var appInfoConfiguration = App.Configuration["AppInfo"];\nChangeToken.OnChange(() => appInfoConfiguration.GetReloadToken(), () =>\n{\n  var name = appInfoConfiguration["Name"];  // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n  var version = appInfoConfiguration["Version"];  // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n});\n')),Object(r.b)("h2",{id:"417-\u914d\u7f6e\u7684\u4f18\u7f3a\u70b9"},"4.1.7 \u914d\u7f6e\u7684\u4f18\u7f3a\u70b9"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"\u80fd\u591f\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u5feb\u901f\u8bfb\u53d6"),Object(r.b)("li",{parentName:"ul"},"\u65e0\u9700\u989d\u5916\u914d\u7f6e"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},"\u5b58\u5728\u91cd\u590d\u8bfb\u53d6"),Object(r.b)("li",{parentName:"ul"},"\u901a\u8fc7\u786c\u7f16\u7801\u5b57\u7b26\u4e32\u8bfb\u53d6\uff0c\u5bb9\u6613\u51fa\u9519"),Object(r.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u8bbe\u7f6e\u9ed8\u8ba4\u503c"),Object(r.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u5728\u8fd0\u884c\u73af\u5883\u4e2d\u52a8\u6001\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027"),Object(r.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u66f4\u6539\u901a\u77e5")))),Object(r.b)("h2",{id:"418-\u914d\u7f6e\u4f7f\u7528\u573a\u666f"},"4.1.8 \u914d\u7f6e\u4f7f\u7528\u573a\u666f"),Object(r.b)("p",null,"\u5982\u679c\u53ea\u9700\u8981",Object(r.b)("strong",{parentName:"p"},"\u4e00\u6b21\u6027\u8bfb\u53d6"),"\u914d\u7f6e\u4fe1\u606f\uff0c\u5219\u4f7f\u7528\u914d\u7f6e\uff0c\u5426\u5219\u5e94\u8be5\u4f7f\u7528 \u300a",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/options"}),"4.2 \u9009\u9879"),"\u300b\u4ee3\u66ff\u3002"),Object(r.b)("h2",{id:"419-\u53cd\u9988\u4e0e\u5efa\u8bae"},"4.1.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Fur \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Fur/issues/new?issue"}),"Issue"),"\u3002"))),Object(r.b)("hr",null),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"\u914d\u7f6e")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0"}),"ASP.NET Core - \u914d\u7f6e")," \u7ae0\u8282\u3002"))))}m.isMDXComponent=!0},142:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return j}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function b(e,n){if(null==e)return{};var t,a,i=function(e,n){if(null==e)return{};var t,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)t=r[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},u=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,o=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),s=p(t),u=a,j=s["".concat(o,".").concat(u)]||s[u]||m[u]||r;return t?i.a.createElement(j,c(c({ref:n},l),{},{components:t})):i.a.createElement(j,c({ref:n},l))}));function j(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,o=new Array(r);o[0]=u;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var l=2;l<r;l++)o[l]=t[l];return i.a.createElement.apply(null,o)}return i.a.createElement.apply(null,t)}u.displayName="MDXCreateElement"},143:function(e,n,t){"use strict";var a=t(0),i=t(19);n.a=function(){const e=Object(a.useContext)(i.a);if(null===e)throw new Error("Docusaurus context not provided");return e}},144:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return o}));var a=t(143),i=t(145);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.a)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+o:o}(n,e,t,a)}}function o(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},145:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},146:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(t=a(e[n]))&&(i&&(i+=" "),i+=t);else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}n.a=function(){for(var e,n,t=0,i="";t<arguments.length;)(e=arguments[t++])&&(n=a(e))&&(i&&(i+=" "),i+=n);return i}},147:function(e,n,t){"use strict";var a=t(0);const i=Object(a.createContext)(void 0);n.a=i},148:function(e,n,t){"use strict";var a=t(0),i=t(147);n.a=function(){const e=Object(a.useContext)(i.a);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},149:function(e,n,t){"use strict";var a=t(0),i=t.n(a),r=t(148),o=t(146),c=t(47),b=t.n(c);const l=37,p=39;n.a=function(e){const{block:n,children:t,defaultValue:c,values:s,groupId:m}=e,{tabGroupChoices:u,setTabGroupChoices:j}=Object(r.a)(),[d,O]=Object(a.useState)(c),[N,g]=Object(a.useState)(!1);if(null!=m){const e=u[m];null!=e&&e!==d&&s.some(n=>n.value===e)&&O(e)}const v=e=>{O(e),null!=m&&j(m,e)},f=[],h=e=>{e.metaKey||e.altKey||e.ctrlKey||g(!0)},C=()=>{g(!1)};return Object(a.useEffect)(()=>{window.addEventListener("keydown",h),window.addEventListener("mousedown",C)},[]),i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(o.a)("tabs",{"tabs--block":n})},s.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":d===e,className:Object(o.a)("tabs__item",b.a.tabItem,{"tabs__item--active":d===e}),style:N?{}:{outline:"none"},key:e,ref:e=>f.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case p:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case l:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(f,e.target,e),h(e)},onFocus:()=>v(e),onClick:()=>{v(e),g(!1)},onPointerDown:()=>g(!1)},n))),i.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(t).filter(e=>e.props.value===d)[0]))}},150:function(e,n,t){"use strict";var a=t(0),i=t.n(a);n.a=function(e){return i.a.createElement("div",null,e.children)}}}]);