10 lines
59 KiB
JavaScript
10 lines
59 KiB
JavaScript
/*!
|
||
* This source file is part of the Swift.org open source project
|
||
*
|
||
* Copyright (c) 2021 Apple Inc. and the Swift project authors
|
||
* Licensed under Apache License v2.0 with Runtime Library Exception
|
||
*
|
||
* See https://swift.org/LICENSE.txt for license information
|
||
* See https://swift.org/CONTRIBUTORS.txt for Swift project authors
|
||
*/
|
||
"use strict";(self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[162],{7214:function(e,t,n){n.d(t,{Z:function(){return u}});var s=function(){var e=this,t=e._self._c;return t("SVGIcon",{staticClass:"download-icon",attrs:{viewBox:"0 0 14 14",themeId:"download"}},[t("path",{attrs:{d:"M7 0.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5zM7 1.5c-3.038 0-5.5 2.462-5.5 5.5s2.462 5.5 5.5 5.5c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5z"}}),t("path",{attrs:{d:"M7.51 2.964l-0.001 5.431 1.308-2.041 0.842 0.539-2.664 4.162-2.633-4.164 0.845-0.534 1.303 2.059 0.001-5.452z"}})])},i=[],r=n(9742),o={name:"DownloadIcon",components:{SVGIcon:r.Z}},a=o,l=n(1001),c=(0,l.Z)(a,s,i,!1,null,null,null),u=c.exports},2573:function(e,t,n){n.d(t,{Z:function(){return c}});var s=function(){var e=this,t=e._self._c;return t("router-link",{staticClass:"nav-title-content",attrs:{to:e.to}},[t("span",{staticClass:"title"},[e._t("default")],2),t("span",{staticClass:"subhead"},[e._v(" "),e._t("subhead")],2)])},i=[],r={name:"NavTitleContainer",props:{to:{type:[String,Object],required:!0}}},o=r,a=n(1001),l=(0,a.Z)(o,s,i,!1,null,"854b4dd6",null),c=l.exports},2726:function(e,t,n){n.r(t),n.d(t,{default:function(){return Yi}});var s=function(){var e=this,t=e._self._c;return t("div",[e.topicData?t(e.componentFor(e.topicData),e._b({key:e.topicKey,tag:"component",attrs:{hierarchy:e.hierarchy}},"component",e.propsFor(e.topicData),!1)):e._e()],1)},i=[],r=n(8841),o=n(7188);const{BreakpointName:a}=o["default"].constants;var l,c,u={state:{linkableSections:[],breakpoint:a.large,references:{}},addLinkableSection(e){const t={...e,visibility:0};t.sectionNumber=this.state.linkableSections.length,this.state.linkableSections.push(t)},reset(){this.state.linkableSections=[],this.state.breakpoint=a.large,this.state.references={}},updateLinkableSection(e){this.state.linkableSections=this.state.linkableSections.map((t=>e.anchor===t.anchor?{...t,visibility:e.visibility}:t))},updateBreakpoint(e){this.state.breakpoint=e},setReferences(e){this.state.references=e}},d=function(){var e=this,t=e._self._c;return t("div",{staticClass:"article"},[e.isTargetIDE?e._e():t("NavigationBar",{attrs:{chapters:e.hierarchy.modules,technology:e.metadata.category,topic:e.heroTitle||"",rootReference:e.hierarchy.reference,identifierUrl:e.identifierUrl}}),t("main",{attrs:{id:"app-main",tabindex:"0"}},[e._t("above-hero"),e._l(e.sections,(function(n,s){return t(e.componentFor(n),e._b({key:s,tag:"component"},"component",e.propsFor(n),!1))}))],2),t("PortalTarget",{attrs:{name:"modal-destination",multiple:""}})],1)},p=[],h=n(2433),m=n(4030),v=function(){var e=this,t=e._self._c;return t("NavBase",{attrs:{id:"nav","aria-label":e.technology,hasSolidBackground:""},scopedSlots:e._u([{key:"default",fn:function(){return[t("ReferenceUrlProvider",{attrs:{reference:e.rootReference},scopedSlots:e._u([{key:"default",fn:function({urlWithParams:n}){return[t("NavTitleContainer",{attrs:{to:n},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(e._s(e.technology))]},proxy:!0},{key:"subhead",fn:function(){return[e._v(e._s(e.$tc("tutorials.title",2)))]},proxy:!0}],null,!0)})]}}])})]},proxy:!0},{key:"after-title",fn:function(){return[t("div",{staticClass:"separator"})]},proxy:!0},{key:"tray",fn:function(){return[t("div",{staticClass:"mobile-dropdown-container"},[t("MobileDropdown",{attrs:{options:e.chapters,sections:e.optionsForSections,currentOption:e.currentSection?e.currentSection.title:""},on:{"select-section":e.onSelectSection}})],1),t("div",{staticClass:"dropdown-container"},[t("PrimaryDropdown",{staticClass:"primary-dropdown",attrs:{options:e.chapters,currentOption:e.topic}}),t("ChevronIcon",{staticClass:"icon-inline"}),e.currentSection?t("SecondaryDropdown",{staticClass:"secondary-dropdown",attrs:{options:e.optionsForSections,currentOption:e.currentSection.title,sectionTracker:e.sectionIndicatorText},on:{"select-section":e.onSelectSection}}):e._e()],1),e._t("tray",null,{siblings:e.chapters.length+e.optionsForSections.length})]},proxy:!0}],null,!0)})},f=[],g=function(){var e=this,t=e._self._c;return t("SVGIcon",{staticClass:"chevron-icon",attrs:{viewBox:"0 0 14 14",themeId:"chevron"}},[t("path",{attrs:{d:"M3.22 1.184l0.325-0.38 7.235 6.201-7.235 6.19-0.325-0.38 6.792-5.811-6.792-5.82z"}})])},y=[],C=n(9742),b={name:"ChevronIcon",components:{SVGIcon:C.Z}},_=b,w=n(1001),k=(0,w.Z)(_,g,y,!1,null,null,null),S=k.exports,x=n(2449),A=n(5953),T={name:"ReferenceUrlProvider",mixins:[A.Z],props:{reference:{type:String,required:!0}},computed:{resolvedReference:({references:e,reference:t})=>e[t]||{},url:({resolvedReference:e})=>e.url,title:({resolvedReference:e})=>e.title},render(){return this.$scopedSlots.default({url:this.url,urlWithParams:(0,x.Q2)(this.url,this.$route.query),title:this.title,reference:this.resolvedReference})}},I=T,$=(0,w.Z)(I,l,c,!1,null,null,null),N=$.exports,q=n(3704),P=n(2586),D=n(2573),Z=function(){var e=this,t=e._self._c;return t("NavMenuItems",{staticClass:"mobile-dropdown"},e._l(e.options,(function(n){return t("ReferenceUrlProvider",{key:n.reference,attrs:{reference:n.reference},scopedSlots:e._u([{key:"default",fn:function({title:s}){return[t("NavMenuItemBase",{staticClass:"chapter-list",attrs:{role:"group"}},[t("p",{staticClass:"chapter-name"},[e._v(e._s(s))]),t("ul",{staticClass:"tutorial-list"},e._l(n.projects,(function(n){return t("ReferenceUrlProvider",{key:n.reference,attrs:{reference:n.reference},scopedSlots:e._u([{key:"default",fn:function({url:n,urlWithParams:s,title:i}){return[t("li",{staticClass:"tutorial-list-item"},[t("router-link",{staticClass:"option tutorial",attrs:{to:s,value:i}},[e._v(" "+e._s(i)+" ")]),n===e.$route.path?t("ul",{staticClass:"section-list",attrs:{role:"listbox"}},e._l(e.sections,(function(n){return t("li",{key:n.title},[t("router-link",{class:e.classesFor(n),attrs:{to:{path:n.path,query:e.$route.query},value:n.title},nativeOn:{click:function(t){return e.onClick(n)}}},[e._v(" "+e._s(n.title)+" ")])],1)})),0):e._e()],1)]}}],null,!0)})})),1)])]}}],null,!0)})})),1)},R=[],O=n(535),L=n(2853),B={name:"MobileDropdown",components:{NavMenuItems:L.Z,NavMenuItemBase:O.Z,ReferenceUrlProvider:N},props:{options:{type:Array,required:!0},currentOption:{type:String,required:!0},sections:{type:Array,required:!1,default:()=>[]}},methods:{classesFor(e){return["option","section",{active:this.currentOption===e.title},this.depthClass(e)]},depthClass(e){const{depth:t=0}=e;return`depth${t}`},onClick(e){this.$emit("select-section",e.path)}}},M=B,F=(0,w.Z)(M,Z,R,!1,null,"2c27d339",null),V=F.exports,j=function(){var e=this,t=e._self._c;return t("DropdownCustom",{staticClass:"tutorial-dropdown",attrs:{value:e.currentOption,"aria-label":e.$t("tutorials.nav.current",{thing:e.$t("sections.title")}),isSmall:""},scopedSlots:e._u([{key:"toggle-post-content",fn:function(){return[t("span",{staticClass:"section-tracker"},[e._v(e._s(e.sectionTracker))])]},proxy:!0},{key:"default",fn:function({closeAndFocusToggler:n,contentClasses:s,navigateOverOptions:i,OptionClass:r,ActiveOptionClass:o}){return[t("ul",{staticClass:"options",class:s,attrs:{role:"listbox",tabindex:"0"}},e._l(e.options,(function(s){return t("router-link",{key:s.title,attrs:{to:{path:s.path,query:e.$route.query},custom:""},scopedSlots:e._u([{key:"default",fn:function({navigate:a}){return[t("li",{class:[r,{[o]:e.currentOption===s.title}],attrs:{value:s.title,"aria-selected":e.currentOption===s.title,"aria-current":e.ariaCurrent(s.title),tabindex:-1},on:{click:function(t){return e.setActive(s,a,n,t)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.setActive(s,a,n,t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:n.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:n.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),i(t,1))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),i(t,-1))}]}},[e._v(" "+e._s(s.title)+" ")])]}}],null,!0)})})),1)]}}])})},E=[],H=function(){var e=this,t=e._self._c;return t("BaseDropdown",{staticClass:"dropdown-custom",class:{[e.OpenedClass]:e.isOpen,"dropdown-small":e.isSmall},attrs:{value:e.value},scopedSlots:e._u([{key:"dropdown",fn:function({dropdownClasses:n}){return[t("span",{staticClass:"visuallyhidden",attrs:{id:`DropdownLabel_${e._uid}`}},[e._v(e._s(e.ariaLabel))]),t("button",{ref:"dropdownToggle",staticClass:"form-dropdown-toggle",class:n,attrs:{id:`DropdownToggle_${e._uid}`,"aria-labelledby":`DropdownLabel_${e._uid} DropdownToggle_${e._uid}`,"aria-expanded":e.isOpen?"true":"false","aria-haspopup":"true"},on:{click:e.toggleDropdown,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.openDropdown.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.closeAndFocusToggler.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.openDropdown.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.openDropdown.apply(null,arguments))}]}},[t("span",{staticClass:"form-dropdown-title"},[e._v(e._s(e.value))]),e._t("toggle-post-content")],2)]}},{key:"eyebrow",fn:function(){return[e._t("eyebrow")]},proxy:!0},{key:"after",fn:function(){return[e._t("default",null,null,{value:e.value,isOpen:e.isOpen,contentClasses:["form-dropdown-content",{"is-open":e.isOpen}],closeDropdown:e.closeDropdown,onChangeAction:e.onChangeAction,closeAndFocusToggler:e.closeAndFocusToggler,navigateOverOptions:e.navigateOverOptions,OptionClass:e.OptionClass,ActiveOptionClass:e.ActiveOptionClass})]},proxy:!0}],null,!0)})},U=[],z=function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-element"},[e._t("dropdown",(function(){return[t("select",e._b({directives:[{name:"model",rawName:"v-model",value:e.modelValue,expression:"modelValue"}],class:e.dropdownClasses,on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.modelValue=t.target.multiple?n:n[0]}}},"select",e.$attrs,!1),[e._t("default")],2)]}),{dropdownClasses:e.dropdownClasses,value:e.value}),t("InlineChevronDownIcon",{staticClass:"form-icon",attrs:{"aria-hidden":"true"}}),e.$slots.eyebrow?t("span",{staticClass:"form-label",attrs:{"aria-hidden":"true"}},[e._t("eyebrow")],2):e._e(),e._t("after")],2)},G=[],W=n(5151),Q={name:"BaseDropdown",inheritAttrs:!1,props:{value:{type:String,default:""}},components:{InlineChevronDownIcon:W.Z},computed:{modelValue:{get:({value:e})=>e,set(e){this.$emit("input",e)}},dropdownClasses({value:e}){return["form-dropdown",{"form-dropdown-selectnone":""===e,"no-eyebrow":!this.$slots.eyebrow}]}}},K=Q,X=(0,w.Z)(K,z,G,!1,null,"f934959a",null),Y=X.exports;const J="is-open",ee="option",te="option-active";var ne={name:"DropdownCustom",components:{BaseDropdown:Y},constants:{OpenedClass:J,OptionClass:ee,ActiveOptionClass:te},props:{value:{type:String,default:""},ariaLabel:{type:String,default:""},isSmall:{type:Boolean,default:!1}},data(){return{isOpen:!1,OpenedClass:J,OptionClass:ee,ActiveOptionClass:te}},mounted(){document.addEventListener("click",this.closeOnLoseFocus)},beforeDestroy(){document.removeEventListener("click",this.closeOnLoseFocus)},methods:{onChangeAction(e){this.$emit("input",e)},toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()},async closeAndFocusToggler(){this.closeDropdown(),await this.$nextTick(),this.$refs.dropdownToggle.focus({preventScroll:!0})},closeDropdown(){this.isOpen=!1,this.$emit("close")},openDropdown(){this.isOpen=!0,this.$emit("open"),this.focusActiveLink()},closeOnLoseFocus(e){!this.$el.contains(e.target)&&this.isOpen&&this.closeDropdown()},navigateOverOptions({target:e},t){const n=this.$el.querySelectorAll(`.${ee}`),s=Array.from(n),i=s.indexOf(e),r=s[i+t];r&&r.focus({preventScroll:!0})},async focusActiveLink(){const e=this.$el.querySelector(`.${te}`);e&&(await this.$nextTick(),e.focus({preventScroll:!0}))}}},se=ne,ie=(0,w.Z)(se,H,U,!1,null,"6adda760",null),re=ie.exports,oe={name:"SecondaryDropdown",components:{DropdownCustom:re},props:{options:{type:Array,required:!0},currentOption:{type:String,required:!0},sectionTracker:{type:String,required:!1}},methods:{ariaCurrent(e){return this.currentOption===e&&"section"},setActive(e,t,n,s){t(s),this.$emit("select-section",e.path),n()}}},ae=oe,le=(0,w.Z)(ae,j,E,!1,null,"618ff780",null),ce=le.exports,ue=function(){var e=this,t=e._self._c;return t("DropdownCustom",{staticClass:"tutorial-dropdown",attrs:{value:e.currentOption,"aria-label":e.$t("tutorials.nav.current",{thing:e.$tc("tutorials.title",1)}),isSmall:""},scopedSlots:e._u([{key:"default",fn:function({closeAndFocusToggler:n,contentClasses:s,closeDropdown:i,navigateOverOptions:r,OptionClass:o,ActiveOptionClass:a}){return[t("ul",{staticClass:"options",class:s,attrs:{tabindex:"0"}},e._l(e.options,(function(s){return t("ReferenceUrlProvider",{key:s.reference,attrs:{reference:s.reference},scopedSlots:e._u([{key:"default",fn:function({title:l}){return[t("li",{staticClass:"chapter-list",attrs:{role:"group"}},[t("p",{staticClass:"chapter-name"},[e._v(e._s(l))]),t("ul",{attrs:{role:"listbox"}},e._l(s.projects,(function(s){return t("ReferenceUrlProvider",{key:s.reference,attrs:{reference:s.reference},scopedSlots:e._u([{key:"default",fn:function({urlWithParams:s,title:l}){return[t("router-link",{attrs:{to:s,custom:""},scopedSlots:e._u([{key:"default",fn:function({navigate:s,isActive:c}){return[t("li",{class:{[o]:!0,[a]:c},attrs:{value:l,"aria-selected":c,"aria-current":!!c&&"tutorial",tabindex:-1},on:{click:function(t){return e.setActive(s,i,t)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.setActive(s,i,t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:n.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:n.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),r(t,1))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),r(t,-1))}]}},[e._v(" "+e._s(l)+" ")])]}}],null,!0)})]}}],null,!0)})})),1)])]}}],null,!0)})})),1)]}}])})},de=[],pe={name:"PrimaryDropdown",components:{DropdownCustom:re,ReferenceUrlProvider:N},props:{options:{type:Array,required:!0},currentOption:{type:String,required:!0}},methods:{setActive(e,t,n){e(n),t()}}},he=pe,me=(0,w.Z)(he,ue,de,!1,null,"03cbd7f7",null),ve=me.exports;const fe={title:"Introduction",url:"#introduction",reference:"introduction",sectionNumber:0,depth:0};var ge={name:"NavigationBar",components:{NavTitleContainer:D.Z,NavBase:P.Z,ReferenceUrlProvider:N,PrimaryDropdown:ve,SecondaryDropdown:ce,MobileDropdown:V,ChevronIcon:S},mixins:[q.Z,A.Z],props:{chapters:{type:Array,required:!0},technology:{type:String,required:!0},topic:{type:String,required:!0},rootReference:{type:String,required:!0},identifierUrl:{type:String,required:!0}},data(){return{currentSection:fe,tutorialState:this.store.state}},watch:{pageSectionWithHighestVisibility(e){e&&(this.currentSection=e)}},computed:{currentProject(){return this.chapters.reduce(((e,{projects:t})=>e.concat(t)),[]).find((e=>e.reference===this.identifierUrl))},pageSections(){if(!this.currentProject)return[];const e=[fe].concat(this.currentProject.sections);return this.tutorialState.linkableSections.map(((t,n)=>{const s=e[n],i=this.references[s.reference],{url:r,title:o}=i||s;return{...t,title:o,path:r}}))},optionsForSections(){return this.pageSections.map((({depth:e,path:t,title:n})=>({depth:e,path:t,title:n})))},pageSectionWithHighestVisibility(){return[...this.pageSections].sort(((e,t)=>t.visibility-e.visibility)).find((e=>e.visibility>0))},sectionIndicatorText(){const e=this.tutorialState.linkableSections.length-1,{sectionNumber:t}=this.currentSection||{};if(0!==t)return this.$t("tutorials.section-of",{number:t,total:e})}},methods:{onSelectSection(e){const t=e.split("#")[1];this.handleFocusAndScroll(t)}}},ye=ge,Ce=(0,w.Z)(ye,v,f,!1,null,"1d3fe8ed",null),be=Ce.exports,_e=n(2974),we=function(){var e=this,t=e._self._c;return t("div",{staticClass:"body"},[t("BodyContent",{attrs:{content:e.content}})],1)},ke=[],Se=function(){var e=this,t=e._self._c;return t("article",{staticClass:"body-content"},e._l(e.content,(function(n,s){return t(e.componentFor(n),e._b({key:s,tag:"component",staticClass:"layout"},"component",e.propsFor(n),!1))})),1)},xe=[],Ae=function(){var e=this,t=e._self._c;return t("div",{staticClass:"columns",class:e.classes},[e._l(e.columns,(function(n,s){return[t("Asset",{key:n.media,attrs:{identifier:n.media,videoAutoplays:!1}}),n.content?t("ContentNode",{key:s,attrs:{content:n.content}}):e._e()]}))],2)},Te=[],Ie=n(4655),$e=function(){var e=this,t=e._self._c;return t("BaseContentNode",{attrs:{content:e.articleContent}})},Ne=[],qe=n(9519),Pe={name:"ContentNode",components:{BaseContentNode:qe["default"]},props:qe["default"].props,computed:{articleContent(){return this.map((e=>{switch(e.type){case qe["default"].BlockType.codeListing:return{...e,showLineNumbers:!0};case qe["default"].BlockType.heading:{const{anchor:t,...n}=e;return n}default:return e}}))}},methods:qe["default"].methods,BlockType:qe["default"].BlockType,InlineType:qe["default"].InlineType},De=Pe,Ze=(0,w.Z)(De,$e,Ne,!1,null,"0861b5be",null),Re=Ze.exports,Oe={name:"Columns",components:{Asset:Ie.Z,ContentNode:Re},props:{columns:{type:Array,required:!0}},computed:{classes(){return{"cols-2":2===this.columns.length,"cols-3":3===this.columns.length}}}},Le=Oe,Be=(0,w.Z)(Le,Ae,Te,!1,null,"30edf911",null),Me=Be.exports,Fe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"content-and-media",class:e.classes},[t("ContentNode",{attrs:{content:e.content}}),t("Asset",{attrs:{identifier:e.media}})],1)},Ve=[];const je={leading:"leading",trailing:"trailing"};var Ee={name:"ContentAndMedia",components:{Asset:Ie.Z,ContentNode:Re},props:{content:Re.props.content,media:Ie.Z.props.identifier,mediaPosition:{type:String,default:()=>je.trailing,validator:e=>Object.prototype.hasOwnProperty.call(je,e)}},computed:{classes(){return{"media-leading":this.mediaPosition===je.leading,"media-trailing":this.mediaPosition===je.trailing}}},MediaPosition:je},He=Ee,Ue=(0,w.Z)(He,Fe,Ve,!1,null,"3fa44f9e",null),ze=Ue.exports,Ge=function(){var e=this,t=e._self._c;return t("div",{staticClass:"full-width"},e._l(e.groups,(function(n,s){return t(e.componentFor(n),e._b({key:s,tag:"component",staticClass:"group"},"component",e.propsFor(n),!1),[t("ContentNode",{attrs:{content:n.content}})],1)})),1)},We=[],Qe=function(){var e=this,t=e._self._c;return t(e.tag,{tag:"component",attrs:{id:e.anchor}},[e._t("default")],2)},Ke=[],Xe=n(9146),Ye={name:"LinkableElement",mixins:[Xe["default"]],inject:{navigationBarHeight:{default(){}},store:{default(){return{addLinkableSection(){},updateLinkableSection(){}}}}},props:{anchor:{type:String,required:!0},depth:{type:Number,default:()=>0},tag:{type:String,default:()=>"div"},title:{type:String,required:!0}},computed:{intersectionRootMargin(){const e=this.navigationBarHeight?`-${this.navigationBarHeight}px`:"0%";return`${e} 0% -50% 0%`}},created(){this.store.addLinkableSection({anchor:this.anchor,depth:this.depth,title:this.title,visibility:0})},methods:{onIntersect(e){const t=Math.min(1,e.intersectionRatio);this.store.updateLinkableSection({anchor:this.anchor,depth:this.depth,title:this.title,visibility:t})}}},Je=Ye,et=(0,w.Z)(Je,Qe,Ke,!1,null,null,null),tt=et.exports;const{BlockType:nt}=Re;var st={name:"FullWidth",components:{ContentNode:Re,LinkableElement:tt},props:Re.props,computed:{groups:({content:e})=>e.reduce(((e,t)=>0===e.length||t.type===nt.heading?[...e,{heading:t.type===nt.heading?t:null,content:[t]}]:[...e.slice(0,e.length-1),{heading:e[e.length-1].heading,content:e[e.length-1].content.concat(t)}]),[])},methods:{componentFor(e){return e.heading?tt:"div"},depthFor(e){switch(e.level){case 1:case 2:return 0;default:return 1}},propsFor(e){return e.heading?{anchor:e.heading.anchor,depth:this.depthFor(e.heading),title:e.heading.text}:{}}}},it=st,rt=(0,w.Z)(it,Ge,We,!1,null,"5b4a8b3c",null),ot=rt.exports;const at={columns:"columns",contentAndMedia:"contentAndMedia",fullWidth:"fullWidth"};var lt={name:"BodyContent",props:{content:{type:Array,required:!0,validator:e=>e.every((({kind:e})=>Object.prototype.hasOwnProperty.call(at,e)))}},methods:{componentFor(e){return{[at.columns]:Me,[at.contentAndMedia]:ze,[at.fullWidth]:ot}[e.kind]},propsFor(e){const{content:t,kind:n,media:s,mediaPosition:i}=e;return{[at.columns]:{columns:t},[at.contentAndMedia]:{content:t,media:s,mediaPosition:i},[at.fullWidth]:{content:t}}[n]}},LayoutKind:at},ct=lt,ut=(0,w.Z)(ct,Se,xe,!1,null,"4d5a806e",null),dt=ut.exports,pt={name:"Body",components:{BodyContent:dt},props:dt.props},ht=pt,mt=(0,w.Z)(ht,we,ke,!1,null,"20dca692",null),vt=mt.exports,ft=function(){var e=this,t=e._self._c;return t("TutorialCTA",e._b({},"TutorialCTA",e.$props,!1))},gt=[],yt=function(){var e=this,t=e._self._c;return t("BaseCTA",e._b({attrs:{label:e.$t("tutorials.next")}},"BaseCTA",e.baseProps,!1))},Ct=[],bt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"call-to-action"},[t("Row",[t("LeftColumn",[t("span",{staticClass:"label"},[e._v(e._s(e.label))]),t("h2",[e._v(" "+e._s(e.title)+" ")]),e.abstract?t("ContentNode",{staticClass:"description",attrs:{content:[e.abstractParagraph]}}):e._e(),e.action?t("Button",{attrs:{action:e.action}}):e._e()],1),t("RightColumn",{staticClass:"right-column"},[e.media?t("Asset",{staticClass:"media",attrs:{identifier:e.media}}):e._e()],1)],1)],1)},_t=[],wt=n(9649),kt=n(1576),St=n(7605),xt={name:"CallToAction",components:{Asset:Ie.Z,Button:St.Z,ContentNode:qe["default"],LeftColumn:{render(e){return e(kt.Z,{props:{span:{large:5,small:12}}},this.$slots.default)}},RightColumn:{render(e){return e(kt.Z,{props:{span:{large:6,small:12}}},this.$slots.default)}},Row:wt.Z},props:{title:{type:String,required:!0},label:{type:String,required:!0},abstract:{type:Array,required:!1},action:{type:Object,required:!1},media:{type:String,required:!1}},computed:{abstractParagraph(){return{type:"paragraph",inlineContent:this.abstract}}}},At=xt,Tt=(0,w.Z)(At,bt,_t,!1,null,"2bfdf182",null),It=Tt.exports,$t={name:"CallToAction",components:{BaseCTA:It},computed:{baseProps(){return{title:this.title,abstract:this.abstract,action:this.action,media:this.media}}},props:{title:{type:String,required:!0},abstract:{type:Array,required:!1},action:{type:Object,required:!1},media:{type:String,required:!1}}},Nt=$t,qt=(0,w.Z)(Nt,yt,Ct,!1,null,null,null),Pt=qt.exports,Dt={name:"CallToAction",components:{TutorialCTA:Pt},props:Pt.props},Zt=Dt,Rt=(0,w.Z)(Zt,ft,gt,!1,null,"426a965c",null),Ot=Rt.exports,Lt=function(){var e=this,t=e._self._c;return t("TutorialHero",e._b({},"TutorialHero",e.$props,!1))},Bt=[],Mt=function(){var e=this,t=e._self._c;return t("LinkableSection",{staticClass:"tutorial-hero",attrs:{anchor:"introduction",title:e.sectionTitle}},[t("div",{staticClass:"hero dark"},[e.backgroundImageUrl?t("div",{staticClass:"bg",style:e.bgStyle}):e._e(),e._t("above-title"),t("Row",[t("Column",[t("Headline",{attrs:{level:1},scopedSlots:e._u([e.chapter?{key:"eyebrow",fn:function(){return[e._v(e._s(e.chapter))]},proxy:!0}:null],null,!0)},[e._v(" "+e._s(e.title)+" ")]),e.content||e.video?t("div",{staticClass:"intro"},[e.content?t("ContentNode",{attrs:{content:e.content}}):e._e(),e.video?[t("p",[t("a",{staticClass:"call-to-action",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.toggleCallToActionModal.apply(null,arguments)}}},[e._v(" Watch intro video "),t("PlayIcon",{staticClass:"cta-icon icon-inline"})],1)]),t("GenericModal",{attrs:{visible:e.callToActionModalVisible,isFullscreen:"",theme:"dark"},on:{"update:visible":function(t){e.callToActionModalVisible=t}}},[t("Asset",{directives:[{name:"show",rawName:"v-show",value:e.callToActionModalVisible,expression:"callToActionModalVisible"}],ref:"asset",staticClass:"video-asset",attrs:{identifier:e.video},on:{videoEnded:e.handleVideoEnd}})],1)]:e._e()],2):e._e(),t("Metadata",{staticClass:"metadata",attrs:{projectFilesUrl:e.projectFilesUrl,estimatedTimeInMinutes:e.estimatedTimeInMinutes,xcodeRequirement:e.xcodeRequirementData}})],1)],1)],2)])},Ft=[],Vt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"headline"},[e.$slots.eyebrow?t("span",{staticClass:"eyebrow"},[e._t("eyebrow")],2):e._e(),t("Heading",{staticClass:"heading",attrs:{level:e.level}},[e._t("default")],2)],1)},jt=[];const Et=1,Ht=6,Ut={type:Number,required:!0,validator:e=>e>=Et&&e<=Ht},zt={name:"Heading",render:function(e){return e(`h${this.level}`,this.$slots.default)},props:{level:Ut}};var Gt={name:"Headline",components:{Heading:zt},props:{level:Ut}},Wt=Gt,Qt=(0,w.Z)(Wt,Vt,jt,!1,null,"d46a1474",null),Kt=Qt.exports,Xt=n(5590),Yt=n(6698),Jt=n(5947),en=function(){var e=this,t=e._self._c;return t("div",{staticClass:"metadata"},[e.estimatedTimeInMinutes?t("div",{staticClass:"item",attrs:{"aria-label":`\n ${e.$tc("tutorials.time.minutes.full",e.estimatedTimeInMinutes,{count:e.estimatedTimeInMinutes})}\n ${e.$t("tutorials.estimated-time")}\n `}},[t("div",{staticClass:"content",attrs:{"aria-hidden":"true"}},[t("i18n",{staticClass:"duration",attrs:{path:"tutorials.time.format",tag:"div"},scopedSlots:e._u([{key:"number",fn:function(){return[e._v(" "+e._s(e.estimatedTimeInMinutes)+" ")]},proxy:!0},{key:"minutes",fn:function(){return[t("div",{staticClass:"minutes"},[e._v(e._s(e.$tc("tutorials.time.minutes.short",e.estimatedTimeInMinutes))+" ")])]},proxy:!0}],null,!1,3313752798)})],1),t("div",{staticClass:"bottom",attrs:{"aria-hidden":"true"}},[e._v(e._s(e.$t("tutorials.estimated-time")))])]):e._e(),e.projectFilesUrl?t("div",{staticClass:"item"},[t("DownloadIcon",{staticClass:"item-large-icon icon-inline"}),t("div",{staticClass:"content bottom"},[t("a",{staticClass:"content-link project-download",attrs:{href:e.projectFilesUrl}},[e._v(" "+e._s(e.$t("tutorials.project-files"))+" "),t("InlineDownloadIcon",{staticClass:"small-icon icon-inline"})],1)])],1):e._e(),e.xcodeRequirement?t("div",{staticClass:"item"},[t("XcodeIcon",{staticClass:"item-large-icon icon-inline"}),t("div",{staticClass:"content bottom"},[e.isTargetIDE?t("span",[e._v(e._s(e.xcodeRequirement.title))]):t("a",{staticClass:"content-link",attrs:{href:e.xcodeRequirement.url}},[e._v(" "+e._s(e.xcodeRequirement.title)+" "),t("InlineChevronRightIcon",{staticClass:"icon-inline small-icon xcode-icon"})],1)])],1):e._e()])},tn=[],nn=n(7214),sn=function(){var e=this,t=e._self._c;return t("SVGIcon",{staticClass:"xcode-icon",attrs:{viewBox:"0 0 14 14",themeId:"xcode"}},[t("path",{attrs:{d:"M2.668 4.452l-1.338-2.229 0.891-0.891 2.229 1.338 1.338 2.228 3.667 3.666 0.194-0.194 2.933 2.933c0.13 0.155 0.209 0.356 0.209 0.576 0 0.497-0.403 0.9-0.9 0.9-0.22 0-0.421-0.079-0.577-0.209l0.001 0.001-2.934-2.933 0.181-0.181-3.666-3.666z"}}),t("path",{attrs:{d:"M11.824 1.277l-0.908 0.908c-0.091 0.091-0.147 0.216-0.147 0.354 0 0.106 0.033 0.205 0.090 0.286l-0.001-0.002 0.058 0.069 0.185 0.185c0.090 0.090 0.215 0.146 0.353 0.146 0.107 0 0.205-0.033 0.286-0.090l-0.002 0.001 0.069-0.057 0.909-0.908c0.118 0.24 0.187 0.522 0.187 0.82 0 1.045-0.848 1.893-1.893 1.893-0.296 0-0.577-0.068-0.826-0.189l0.011 0.005-5.5 5.5c0.116 0.238 0.184 0.518 0.184 0.813 0 1.045-0.848 1.893-1.893 1.893-0.296 0-0.576-0.068-0.826-0.189l0.011 0.005 0.908-0.909c0.090-0.090 0.146-0.215 0.146-0.353 0-0.107-0.033-0.205-0.090-0.286l0.001 0.002-0.057-0.069-0.185-0.185c-0.091-0.091-0.216-0.147-0.354-0.147-0.106 0-0.205 0.033-0.286 0.090l0.002-0.001-0.069 0.058-0.908 0.908c-0.116-0.238-0.184-0.518-0.184-0.813 0-1.045 0.847-1.892 1.892-1.892 0.293 0 0.571 0.067 0.819 0.186l-0.011-0.005 5.5-5.5c-0.116-0.238-0.184-0.519-0.184-0.815 0-1.045 0.847-1.892 1.892-1.892 0.296 0 0.577 0.068 0.827 0.19l-0.011-0.005z"}})])},rn=[],on={name:"XcodeIcon",components:{SVGIcon:C.Z}},an=on,ln=(0,w.Z)(an,sn,rn,!1,null,null,null),cn=ln.exports,un=n(8785),dn=function(){var e=this,t=e._self._c;return t("SVGIcon",{staticClass:"inline-download-icon",attrs:{viewBox:"0 0 14 14",themeId:"inline-download"}},[t("path",{attrs:{d:"M7 0.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5zM7 1.5c-3.038 0-5.5 2.462-5.5 5.5s2.462 5.5 5.5 5.5c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5z"}}),t("path",{attrs:{d:"M7.51 2.964l-0.001 5.431 1.308-2.041 0.842 0.539-2.664 4.162-2.633-4.164 0.845-0.534 1.303 2.059 0.001-5.452z"}})])},pn=[],hn={name:"InlineDownloadIcon",components:{SVGIcon:C.Z}},mn=hn,vn=(0,w.Z)(mn,dn,pn,!1,null,null,null),fn=vn.exports,gn={name:"HeroMetadata",components:{InlineDownloadIcon:fn,InlineChevronRightIcon:un.Z,DownloadIcon:nn.Z,XcodeIcon:cn},inject:["isTargetIDE"],props:{projectFilesUrl:{type:String},estimatedTimeInMinutes:{type:Number},xcodeRequirement:{type:Object,required:!1}}},yn=gn,Cn=(0,w.Z)(yn,en,tn,!1,null,"94ff76c0",null),bn=Cn.exports,_n={name:"Hero",components:{PlayIcon:Yt.Z,GenericModal:Xt.Z,Column:{render(e){return e(kt.Z,{props:{span:{large:7,medium:9,small:12}}},this.$slots.default)}},ContentNode:qe["default"],Headline:Kt,Metadata:bn,Row:wt.Z,Asset:Ie.Z,LinkableSection:tt},mixins:[A.Z],props:{title:{type:String,required:!0},chapter:{type:String},content:{type:Array},projectFiles:{type:String},estimatedTimeInMinutes:{type:Number},xcodeRequirement:{type:String,required:!1},video:{type:String},backgroundImage:{type:String}},computed:{backgroundImageUrl(){const e=this.references[this.backgroundImage]||{},{variants:t=[]}=e,n=t.find((e=>e.traits.includes("light")));return(0,Jt.AH)((n||{}).url)},projectFilesUrl(){return this.projectFiles?(0,Jt.AH)(this.references[this.projectFiles].url):null},bgStyle(){return{backgroundImage:(0,Jt.eZ)(this.backgroundImageUrl)}},xcodeRequirementData(){return this.references[this.xcodeRequirement]},sectionTitle(){return"Introduction"}},data(){return{callToActionModalVisible:!1}},methods:{async toggleCallToActionModal(){this.callToActionModalVisible=!0,await this.$nextTick();const e=this.$refs.asset.$el.querySelector("video");if(e)try{await e.play(),e.muted=!1}catch(t){}},handleVideoEnd(){this.callToActionModalVisible=!1}}},wn=_n,kn=(0,w.Z)(wn,Mt,Ft,!1,null,"2a434750",null),Sn=kn.exports,xn={name:"Hero",components:{TutorialHero:Sn},props:Sn.props},An=xn,Tn=(0,w.Z)(An,Lt,Bt,!1,null,"35a9482f",null),In=Tn.exports,$n=function(){var e=this,t=e._self._c;return t("TutorialAssessments",e._b({scopedSlots:e._u([{key:"success",fn:function(){return[t("p",[e._v("Great job, you've answered all the questions for this article.")])]},proxy:!0}])},"TutorialAssessments",e.$props,!1))},Nn=[],qn=function(){var e=this,t=e._self._c;return t("LinkableSection",{staticClass:"assessments-wrapper",attrs:{anchor:e.anchor,title:e.title}},[t("Row",{ref:"assessments",staticClass:"assessments"},[t("MainColumn",[t("Row",{staticClass:"banner"},[t("HeaderColumn",[t("h2",{staticClass:"title"},[e._v(e._s(e.title))])])],1),e.completed?t("div",{staticClass:"success"},[e._t("success",(function(){return[t("p",[e._v(e._s(e.SuccessMessage))])]}))],2):t("div",[t("Progress",e._b({ref:"progress"},"Progress",e.progress,!1)),t("Quiz",{key:e.activeIndex,attrs:{choices:e.activeAssessment.choices,content:e.activeAssessment.content,isLast:e.isLast,title:e.activeAssessment.title},on:{submit:e.onSubmit,advance:e.onAdvance,"see-results":e.onSeeResults}})],1),t("div",{staticClass:"visuallyhidden",attrs:{"aria-live":"assertive"}},[e.completed?e._t("success",(function(){return[e._v(" "+e._s(e.SuccessMessage)+" ")]})):e._e()],2)],1)],1)],1)},Pn=[],Dn=function(){var e=this,t=e._self._c;return t("Row",[t("p",{staticClass:"title"},[e._v(e._s(e.$t("tutorials.question-of",{index:e.index,total:e.total})))])])},Zn=[],Rn={name:"AssessmentsProgress",components:{Row:wt.Z},props:{index:{type:Number,required:!0},total:{type:Number,required:!0}}},On=Rn,Ln=(0,w.Z)(On,Dn,Zn,!1,null,"28135d78",null),Bn=Ln.exports,Mn=function(){var e=this,t=e._self._c;return t("div",{staticClass:"quiz"},[t("ContentNode",{staticClass:"title",attrs:{content:e.title}}),e.content?t("ContentNode",{staticClass:"question-content",attrs:{content:e.content}}):e._e(),t("fieldset",{staticClass:"choices"},[t("legend",{staticClass:"visuallyhidden"},[e._v(e._s(e.$t("tutorials.assessment.legend")))]),e._l(e.choices,(function(n,s){return t("label",{key:s,class:e.choiceClasses[s]},[t(e.getIconComponent(s),{tag:"component",staticClass:"choice-icon"}),t("input",{directives:[{name:"model",rawName:"v-model",value:e.selectedIndex,expression:"selectedIndex"}],attrs:{type:"radio",name:"assessment"},domProps:{value:s,checked:e._q(e.selectedIndex,s)},on:{change:function(t){e.selectedIndex=s}}}),t("ContentNode",{staticClass:"question",attrs:{content:n.content}}),e.userChoices[s].checked?[t("ContentNode",{staticClass:"answer",attrs:{content:n.justification}}),n.reaction?t("p",{staticClass:"answer"},[e._v(e._s(n.reaction))]):e._e()]:e._e()],2)}))],2),t("div",{staticClass:"visuallyhidden",attrs:{"aria-live":"assertive"}},[null!=e.checkedIndex?t("i18n",{attrs:{path:"tutorials.assessment.answer-result",tag:"span"},scopedSlots:e._u([{key:"answer",fn:function(){return[t("ContentNode",{staticClass:"question",attrs:{content:e.choices[e.checkedIndex].content}})]},proxy:!0},{key:"result",fn:function(){return[e._v(e._s(e.choices[e.checkedIndex].isCorrect?e.$t("tutorials.assessment.correct"):e.$t("tutorials.assessment.incorrect")))]},proxy:!0}],null,!1,511264553)}):e._e()],1),t("div",{staticClass:"controls"},[t("ButtonLink",{staticClass:"check",attrs:{disabled:null===e.selectedIndex||e.showNextQuestion},nativeOn:{click:function(t){return e.submit.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("tutorials.submit"))+" ")]),e.isLast?t("ButtonLink",{staticClass:"results",attrs:{disabled:!e.showNextQuestion},nativeOn:{click:function(t){return e.seeResults.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("tutorials.next"))+" ")]):t("ButtonLink",{staticClass:"next",attrs:{disabled:!e.showNextQuestion},nativeOn:{click:function(t){return e.advance.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("tutorials.assessment.next-question"))+" ")])],1)],1)},Fn=[],Vn=n(5281),jn=function(){var e=this,t=e._self._c;return t("SVGIcon",{staticClass:"reset-circle-icon",attrs:{viewBox:"0 0 14 14",themeId:"reset-circle"}},[t("path",{attrs:{d:"M7 0.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5c-3.59 0-6.5-2.91-6.5-6.5v0c0-3.59 2.91-6.5 6.5-6.5v0zM7 1.5c-3.038 0-5.5 2.462-5.5 5.5s2.462 5.5 5.5 5.5c3.038 0 5.5-2.462 5.5-5.5v0c0-3.038-2.462-5.5-5.5-5.5v0z"}}),t("path",{attrs:{d:"M3.828 4.539l0.707-0.707 5.657 5.657-0.707 0.707-5.657-5.657z"}}),t("path",{attrs:{d:"M3.828 9.489l5.657-5.657 0.707 0.707-5.657 5.657-0.707-0.707z"}})])},En=[],Hn={name:"ResetCircleIcon",components:{SVGIcon:C.Z}},Un=Hn,zn=(0,w.Z)(Un,jn,En,!1,null,null,null),Gn=zn.exports,Wn=function(){var e=this,t=e._self._c;return t("SVGIcon",{staticClass:"check-circle-icon",attrs:{viewBox:"0 0 14 14",themeId:"check-circle"}},[t("path",{attrs:{d:"M7 0.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5c-3.59 0-6.5-2.91-6.5-6.5v0c0-3.59 2.91-6.5 6.5-6.5v0zM7 1.5c-3.038 0-5.5 2.462-5.5 5.5s2.462 5.5 5.5 5.5c3.038 0 5.5-2.462 5.5-5.5v0c0-3.038-2.462-5.5-5.5-5.5v0z"}}),t("path",{attrs:{d:"M9.626 3.719l0.866 0.5-3.5 6.062-3.464-2 0.5-0.866 2.6 1.5z"}})])},Qn=[],Kn={name:"CheckCircleIcon",components:{SVGIcon:C.Z}},Xn=Kn,Yn=(0,w.Z)(Xn,Wn,Qn,!1,null,null,null),Jn=Yn.exports,es={name:"Quiz",components:{CheckCircleIcon:Jn,ResetCircleIcon:Gn,ContentNode:qe["default"],ButtonLink:Vn.Z},props:{content:{type:Array,required:!1},choices:{type:Array,required:!0},isLast:{type:Boolean,default:!1},title:{type:Array,required:!0}},data(){return{userChoices:this.choices.map((()=>({checked:!1}))),selectedIndex:null,checkedIndex:null}},computed:{correctChoices(){return this.choices.reduce(((e,t,n)=>t.isCorrect?e.add(n):e),new Set)},choiceClasses(){return this.userChoices.map(((e,t)=>({choice:!0,active:this.selectedIndex===t,disabled:e.checked||this.showNextQuestion,correct:e.checked&&this.choices[t].isCorrect,incorrect:e.checked&&!this.choices[t].isCorrect})))},showNextQuestion(){return Array.from(this.correctChoices).every((e=>this.userChoices[e].checked))}},methods:{getIconComponent(e){const t=this.userChoices[e];if(t&&t.checked)return this.choices[e].isCorrect?Jn:Gn},submit(){this.$set(this.userChoices,this.selectedIndex,{checked:!0}),this.checkedIndex=this.selectedIndex,this.$emit("submit")},advance(){this.$emit("advance")},seeResults(){this.$emit("see-results")}}},ts=es,ns=(0,w.Z)(ts,Mn,Fn,!1,null,"61b03ec2",null),ss=ns.exports;const is=12,rs="tutorials.assessment.success-message";var os={name:"Assessments",constants:{SuccessMessage:rs},components:{LinkableSection:tt,Quiz:ss,Progress:Bn,Row:wt.Z,HeaderColumn:{render(e){return e(kt.Z,{props:{isCentered:{large:!0},span:{large:10}}},this.$slots.default)}},MainColumn:{render(e){return e(kt.Z,{props:{isCentered:{large:!0},span:{large:10,medium:10,small:12}}},this.$slots.default)}}},props:{assessments:{type:Array,required:!0},anchor:{type:String,required:!0}},inject:["navigationBarHeight"],data(){return{activeIndex:0,completed:!1,SuccessMessage:this.$t(rs)}},computed:{activeAssessment(){return this.assessments[this.activeIndex]},isLast(){return this.activeIndex===this.assessments.length-1},progress(){return{index:this.activeIndex+1,total:this.assessments.length}},title(){return this.$t("tutorials.assessment.check-your-understanding")}},methods:{scrollTo(e,t=0){e.scrollIntoView(!0),window.scrollBy(0,-this.navigationBarHeight-t)},onSubmit(){this.$nextTick((()=>{this.scrollTo(this.$refs.progress.$el,is)}))},onAdvance(){this.activeIndex+=1,this.$nextTick((()=>{this.scrollTo(this.$refs.progress.$el,is)}))},onSeeResults(){this.completed=!0,this.$nextTick((()=>{this.scrollTo(this.$refs.assessments.$el,is)}))}}},as=os,ls=(0,w.Z)(as,qn,Pn,!1,null,"65e3c02c",null),cs=ls.exports,us={name:"Assessments",components:{TutorialAssessments:cs},props:cs.props},ds=us,ps=(0,w.Z)(ds,$n,Nn,!1,null,"6db06128",null),hs=ps.exports;const ms={articleBody:"articleBody",callToAction:"callToAction",hero:"hero",assessments:"assessments"};var vs={name:"Article",components:{NavigationBar:be,PortalTarget:h.YC},mixins:[_e.Z],inject:{isTargetIDE:{default:!1},store:{default(){return{reset(){},setReferences(){}}}}},props:{hierarchy:{type:Object,required:!0},metadata:{type:Object,required:!0},references:{type:Object,required:!0},sections:{type:Array,required:!0,validator:e=>e.every((({kind:e})=>Object.prototype.hasOwnProperty.call(ms,e)))},identifierUrl:{type:String,required:!0}},computed:{heroSection(){return this.sections.find(this.isHero)},heroTitle(){return(this.heroSection||{}).title},pageTitle(){return this.heroTitle?`${this.heroTitle} — ${this.metadata.category} Tutorials`:void 0},pageDescription:({heroSection:e,extractFirstParagraphText:t})=>e?t(e.content):null},methods:{componentFor(e){const{kind:t}=e;return{[ms.articleBody]:vt,[ms.callToAction]:Ot,[ms.hero]:In,[ms.assessments]:hs}[t]},isHero(e){return e.kind===ms.hero},propsFor(e){const{abstract:t,action:n,anchor:s,assessments:i,backgroundImage:r,chapter:o,content:a,estimatedTimeInMinutes:l,kind:c,media:u,projectFiles:d,title:p,video:h,xcodeRequirement:m}=e;return{[ms.articleBody]:{content:a},[ms.callToAction]:{abstract:t,action:n,media:u,title:p},[ms.hero]:{backgroundImage:r,chapter:o,content:a,estimatedTimeInMinutes:l,projectFiles:d,title:p,video:h,xcodeRequirement:m},[ms.assessments]:{anchor:s,assessments:i}}[c]}},created(){m["default"].setAvailableLocales(this.metadata.availableLocales),this.store.reset(),this.store.setReferences(this.references)},watch:{references(e){this.store.setReferences(e)},"metadata.availableLocales":function(e){m["default"].setAvailableLocales(e)}},SectionKind:ms},fs=vs,gs=(0,w.Z)(fs,d,p,!1,null,"9d2d5cc2",null),ys=gs.exports,Cs=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tutorial"},[e.isTargetIDE?e._e():t("NavigationBar",{attrs:{technology:e.metadata.category,chapters:e.hierarchy.modules,topic:e.tutorialTitle||"",rootReference:e.hierarchy.reference,identifierUrl:e.identifierUrl}}),t("main",{attrs:{id:"app-main",tabindex:"0"}},[e._l(e.sections,(function(e,n){return t("Section",{key:n,attrs:{section:e}})})),t("BreakpointEmitter",{on:{change:e.handleBreakpointChange}})],2),t("PortalTarget",{attrs:{name:"modal-destination",multiple:""}})],1)},bs=[],_s=n(8571),ws=function(){var e=this,t=e._self._c;return t("div",{staticClass:"sections"},e._l(e.tasks,(function(n,s){return t("Section",e._b({key:s,attrs:{id:n.anchor,sectionNumber:s+1,isRuntimePreviewVisible:e.isRuntimePreviewVisible},on:{"runtime-preview-toggle":e.onRuntimePreviewToggle}},"Section",n,!1))})),1)},ks=[],Ss=function(){var e=this,t=e._self._c;return t("LinkableSection",{staticClass:"section",attrs:{anchor:e.anchor,title:e.introProps.title}},[t("Intro",e._b({},"Intro",e.introProps,!1)),e.stepsSection.length>0?t("Steps",{attrs:{content:e.stepsSection,isRuntimePreviewVisible:e.isRuntimePreviewVisible,sectionNumber:e.sectionNumber},on:{"runtime-preview-toggle":e.onRuntimePreviewToggle}}):e._e()],1)},xs=[],As=function(){var e=this,t=e._self._c;return t("div",{staticClass:"intro-container"},[t("Row",{class:["intro",`intro-${e.sectionNumber}`,{ide:e.isTargetIDE}]},[t("Column",{staticClass:"left"},[t("Headline",{attrs:{level:2},scopedSlots:e._u([{key:"eyebrow",fn:function(){return[t("router-link",{attrs:{to:e.sectionLink}},[e._v(" "+e._s(e.$t("sections.title",{number:e.sectionNumber}))+" ")])]},proxy:!0}])},[e._v(" "+e._s(e.title)+" ")]),t("ContentNode",{attrs:{content:e.content}})],1),t("Column",{staticClass:"right"},[t("div",{staticClass:"media"},[e.media?t("Asset",{attrs:{videoAutoplays:"",videoMuted:"",identifier:e.media}}):e._e()],1)])],1),e.expandedSections.length>0?t("ExpandedIntro",{staticClass:"expanded-intro",attrs:{content:e.expandedSections}}):e._e()],1)},Ts=[],Is={name:"SectionIntro",inject:{isTargetIDE:{default:()=>!1}},components:{Asset:Ie.Z,ContentNode:qe["default"],ExpandedIntro:dt,Headline:Kt,Row:wt.Z,Column:{render(e){return e(kt.Z,{props:{span:{large:6,small:12}}},this.$slots.default)}}},props:{sectionAnchor:{type:String,required:!0},content:{type:Array,required:!0},media:{type:String,required:!0},title:{type:String,required:!0},sectionNumber:{type:Number,required:!0},expandedSections:{type:Array,default:()=>[]}},methods:{focus(){this.$emit("focus",this.media)}},computed:{sectionLink(){return{path:this.$route.path,hash:this.sectionAnchor,query:this.$route.query}}}},$s=Is,Ns=(0,w.Z)($s,As,Ts,!1,null,"7dcf2d10",null),qs=Ns.exports,Ps=function(){var e=this,t=e._self._c;return t("div",{staticClass:"steps"},[t("div",{staticClass:"content-container"},e._l(e.contentNodes,(function(n,s){return t(n.component,e._b({key:s,ref:"contentNodes",refInFor:!0,tag:"component",class:e.contentClass(s),attrs:{currentIndex:e.activeStep}},"component",n.props,!1))})),1),e.isBreakpointSmall?e._e():t("BackgroundTheme",{staticClass:"asset-container",class:e.assetContainerClasses},[t("transition",{attrs:{name:"fade"}},[e.visibleAsset.media?t("div",{key:e.visibleAsset.media,class:["asset-wrapper",{ide:e.isTargetIDE}]},[t("Asset",{ref:"asset",staticClass:"step-asset",attrs:{videoAutoplays:"",videoMuted:"",identifier:e.visibleAsset.media}})],1):e._e(),e.visibleAsset.code?t("CodePreview",{attrs:{code:e.visibleAsset.code,preview:e.visibleAsset.runtimePreview,isRuntimePreviewVisible:e.isRuntimePreviewVisible},on:{"runtime-preview-toggle":e.onRuntimePreviewToggle}},[e.visibleAsset.runtimePreview?t("transition",{attrs:{name:"fade"}},[t("Asset",{key:e.visibleAsset.runtimePreview,attrs:{identifier:e.visibleAsset.runtimePreview}})],1):e._e()],1):e._e()],1)],1)],1)},Ds=[],Zs=function(){var e=this,t=e._self._c;return t("div",{class:["code-preview",{ide:e.isTargetIDE}]},[t("CodeTheme",[e.code?t("CodeListing",e._b({attrs:{showLineNumbers:""}},"CodeListing",e.codeProps,!1)):e._e()],1),t("div",{staticClass:"runtime-preview",class:e.runtimePreviewClasses,style:e.previewStyles},[t("div",{staticClass:"runtimve-preview__container"},[t("button",{staticClass:"header",attrs:{disabled:!e.hasRuntimePreview,title:e.runtimePreviewTitle},on:{click:e.togglePreview}},[t("span",{staticClass:"runtime-preview-label",attrs:{"aria-label":e.textAriaLabel}},[e._v(e._s(e.togglePreviewText))]),t("DiagonalArrowIcon",{staticClass:"icon-inline preview-icon",class:[e.shouldDisplayHideLabel?"preview-hide":"preview-show"]})],1),t("transition",{on:{leave:e.handleLeave}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.shouldDisplayHideLabel,expression:"shouldDisplayHideLabel"}],staticClass:"runtime-preview-asset"},[e._t("default")],2)])],1)])],1)},Rs=[],Os=n(5996),Ls=n(6817),Bs=n(8093);const{BreakpointName:Ms}=o["default"].constants;function Fs({width:e,height:t},n=1){const s=400,i=e<=s?1.75:3;return{width:e/(i/n),height:t/(i/n)}}var Vs={name:"CodePreview",inject:{isTargetIDE:{default:!1},store:{default(){return{state:{references:{}}}}}},components:{DiagonalArrowIcon:Ls.Z,CodeListing:Os.Z,CodeTheme:Bs.Z},props:{code:{type:String,required:!0},preview:{type:String,required:!1},isRuntimePreviewVisible:{type:Boolean,required:!0}},data(){return{tutorialState:this.store.state}},computed:{references:({tutorialState:e})=>e.references,currentBreakpoint(){return this.tutorialState.breakpoint},hasRuntimePreview(){return!!this.preview},previewAssetSize(){const e=this.hasRuntimePreview?this.references[this.preview]:{},t=(e.variants||[{}])[0]||{},n={width:900};let s=t.size||{};s.width||s.height||(s=n);const i=this.currentBreakpoint===Ms.medium?.8:1;return Fs(s,i)},previewSize(){const e={width:102};return this.shouldDisplayHideLabel&&this.previewAssetSize?{width:this.previewAssetSize.width}:e},previewStyles(){const{width:e}=this.previewSize;return{width:`${e}px`}},codeProps(){return this.references[this.code]},runtimePreviewClasses(){return{collapsed:!this.shouldDisplayHideLabel,disabled:!this.hasRuntimePreview,"runtime-preview-ide":this.isTargetIDE}},shouldDisplayHideLabel(){return this.hasRuntimePreview&&this.isRuntimePreviewVisible},runtimePreviewTitle(){return this.hasRuntimePreview?null:this.$t("tutorials.preview.no-preview-available-step")},togglePreviewText(){return this.$tc("tutorials.preview.title",this.hasRuntimePreview?1:0)},textAriaLabel(){return`${this.togglePreviewText}, ${this.shouldDisplayHideLabel?this.$t("verbs.hide"):this.$t("verbs.show")}`}},methods:{handleLeave(e,t){setTimeout(t,200)},togglePreview(){this.hasRuntimePreview&&this.$emit("runtime-preview-toggle",!this.isRuntimePreviewVisible)}}},js=Vs,Es=(0,w.Z)(js,Zs,Rs,!1,null,"395e30cd",null),Hs=Es.exports,Us=n(5657),zs=function(){var e=this,t=e._self._c;return t("div",{style:e.backgroundStyle},[e._t("default")],2)},Gs=[],Ws={name:"BackgroundTheme",data(){return{codeThemeState:_s.Z.state}},computed:{backgroundStyle(){const{codeColors:e}=this.codeThemeState;return e?{"--background":e.background}:null}}},Qs=Ws,Ks=(0,w.Z)(Qs,zs,Gs,!1,null,null,null),Xs=Ks.exports,Ys=function(){var e=this,t=e._self._c;return t("div",{class:["step-container",`step-${e.stepNumber}`]},[t("div",{ref:"step",staticClass:"step",class:{focused:e.isActive},attrs:{"data-index":e.index}},[t("p",{staticClass:"step-label"},[e._v(e._s(e.$t("tutorials.step",{number:e.stepNumber})))]),t("ContentNode",{attrs:{content:e.content}}),e.caption&&e.caption.length>0?t("ContentNode",{staticClass:"caption",attrs:{content:e.caption}}):e._e()],1),e.isBreakpointSmall||!e.isTargetIDE?t("div",{staticClass:"media-container"},[e.media?t("Asset",{attrs:{identifier:e.media,videoAutoplays:"",videoMuted:""}}):e._e(),e.code?t("MobileCodePreview",{attrs:{code:e.code}},[e.runtimePreview?t("Asset",{staticClass:"preview",attrs:{identifier:e.runtimePreview}}):e._e()],1):e._e()],1):e._e()])},Js=[],ei=function(){var e=this,t=e._self._c;return t("BackgroundTheme",{staticClass:"mobile-code-preview"},[e.code?t("GenericModal",{staticClass:"full-code-listing-modal",attrs:{theme:e.isTargetIDE?"code":"light",codeBackgroundColorOverride:e.modalBackgroundColor,isFullscreen:"",visible:e.fullCodeIsVisible},on:{"update:visible":function(t){e.fullCodeIsVisible=t}}},[t("div",{staticClass:"full-code-listing-modal-content"},[t("CodeTheme",[t("CodeListing",e._b({staticClass:"full-code-listing",attrs:{showLineNumbers:""}},"CodeListing",e.codeProps,!1))],1)],1)]):e._e(),t("CodeTheme",[e.code?t("MobileCodeListing",e._b({attrs:{showLineNumbers:""},on:{"file-name-click":e.toggleFullCode}},"MobileCodeListing",e.codeProps,!1)):e._e()],1),t("CodeTheme",{staticClass:"preview-toggle-container"},[t("PreviewToggle",{attrs:{isActionable:!!e.$slots.default},on:{click:e.togglePreview}})],1),e.$slots.default?t("GenericModal",{staticClass:"runtime-preview-modal",attrs:{theme:e.isTargetIDE?"dynamic":"light",isFullscreen:"",visible:e.previewIsVisible},on:{"update:visible":function(t){e.previewIsVisible=t}}},[t("div",{staticClass:"runtime-preview-modal-content"},[t("span",{staticClass:"runtime-preview-label"},[e._v(e._s(e.$tc("tutorials.preview.title",1)))]),e._t("default")],2)]):e._e()],1)},ti=[],ni=function(){var e=this,t=e._self._c;return t("div",{staticClass:"code-listing-preview",attrs:{"data-syntax":e.syntax}},[t("CodeListing",{attrs:{fileName:e.fileName,syntax:e.syntax,fileType:e.fileType,content:e.previewedLines,startLineNumber:e.displayedRange.start,highlights:e.highlights,showLineNumbers:"",isFileNameActionable:""},on:{"file-name-click":function(t){return e.$emit("file-name-click")}}})],1)},si=[],ii={name:"MobileCodeListing",components:{CodeListing:Os.Z},props:{fileName:String,syntax:String,fileType:String,content:{type:Array,required:!0},highlights:{type:Array,default:()=>[]}},computed:{highlightedLineNumbers(){return new Set(this.highlights.map((({line:e})=>e)))},firstHighlightRange(){if(0===this.highlightedLineNumbers.size)return{start:1,end:this.content.length};const e=Math.min(...this.highlightedLineNumbers.values());let t=e;while(this.highlightedLineNumbers.has(t+1))t+=1;return{start:e,end:t}},displayedRange(){const e=this.firstHighlightRange,t=e.start-2<1?1:e.start-2,n=e.end+3>=this.content.length+1?this.content.length+1:e.end+3;return{start:t,end:n}},previewedLines(){return this.content.slice(this.displayedRange.start-1,this.displayedRange.end-1)}}},ri=ii,oi=(0,w.Z)(ri,ni,si,!1,null,"0bdf2f26",null),ai=oi.exports,li=function(){var e=this,t=e._self._c;return t("span",{staticClass:"toggle-preview"},[e.isActionable?t("a",{staticClass:"toggle-text",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.$emit("click")}}},[e._v(" "+e._s(e.$tc("tutorials.preview.title",1))+" "),t("InlinePlusCircleIcon",{staticClass:"toggle-icon icon-inline"})],1):t("span",{staticClass:"toggle-text"},[e._v(" "+e._s(e.$tc("tutorials.preview.title",0))+" ")])])},ci=[],ui=n(6772),di={name:"MobileCodePreviewToggle",components:{InlinePlusCircleIcon:ui.Z},props:{isActionable:{type:Boolean,required:!0}}},pi=di,hi=(0,w.Z)(pi,li,ci,!1,null,"78763c14",null),mi=hi.exports,vi={name:"MobileCodePreview",inject:["isTargetIDE"],mixins:[A.Z],components:{GenericModal:Xt.Z,CodeListing:Os.Z,MobileCodeListing:ai,PreviewToggle:mi,CodeTheme:Bs.Z,BackgroundTheme:Xs},props:{code:{type:String,required:!0}},computed:{codeProps(){return this.references[this.code]},modalBackgroundColor(){const{codeColors:e}=this.store.state;return e?e.background:null}},data(){return{previewIsVisible:!1,fullCodeIsVisible:!1}},methods:{togglePreview(){this.previewIsVisible=!this.previewIsVisible},toggleFullCode(){this.fullCodeIsVisible=!this.fullCodeIsVisible}}},fi=vi,gi=(0,w.Z)(fi,ei,ti,!1,null,"b1691954",null),yi=gi.exports;const{BreakpointName:Ci}=o["default"].constants;var bi={name:"Step",components:{Asset:Ie.Z,MobileCodePreview:yi,ContentNode:qe["default"]},inject:["isTargetIDE","store"],props:{code:{type:String,required:!1},content:{type:Array,required:!0},caption:{type:Array,required:!1},media:{type:String,required:!1},runtimePreview:{type:String,required:!1},sectionNumber:{type:Number,required:!0},stepNumber:{type:Number,required:!0},numberOfSteps:{type:Number,required:!0},index:{type:Number,required:!0},currentIndex:{type:Number,required:!0}},data(){return{tutorialState:this.store.state}},computed:{isBreakpointSmall(){return this.tutorialState.breakpoint===Ci.small},isActive:({index:e,currentIndex:t})=>e===t}},_i=bi,wi=(0,w.Z)(_i,Ys,Js,!1,null,"d0198556",null),ki=wi.exports;const{BreakpointName:Si}=o["default"].constants,{IntersectionDirections:xi}=Xe["default"].constants,Ai="-35% 0% -65% 0%";var Ti={name:"SectionSteps",components:{ContentNode:qe["default"],Step:ki,Asset:Ie.Z,CodePreview:Hs,BackgroundTheme:Xs},mixins:[Xe["default"]],constants:{IntersectionMargins:Ai},inject:["isTargetIDE","store"],data(){const e=this.content.findIndex(this.isStepNode),{code:t,media:n,runtimePreview:s}=this.content[e]||{};return{tutorialState:this.store.state,visibleAsset:{media:n,code:t,runtimePreview:s},activeStep:e}},computed:{assetContainerClasses(){return{"for-step-code":!!this.visibleAsset.code,ide:this.isTargetIDE}},numberOfSteps(){return this.content.filter(this.isStepNode).length},contentNodes(){return this.content.reduce((({stepCounter:e,nodes:t},n,s)=>{const{type:i,...r}=n,o=this.isStepNode(n),a=o?e+1:e;return o?{stepCounter:e+1,nodes:t.concat({component:ki,type:i,props:{...r,stepNumber:a,index:s,numberOfSteps:this.numberOfSteps,sectionNumber:this.sectionNumber}})}:{stepCounter:e,nodes:t.concat({component:qe["default"],type:i,props:{content:[n]}})}}),{stepCounter:0,nodes:[]}).nodes},isBreakpointSmall(){return this.tutorialState.breakpoint===Si.small},stepNodes:({contentNodes:e,isStepNode:t})=>e.filter(t),intersectionRootMargin:()=>Ai},async mounted(){await(0,Us.J)(8),this.findClosestStepNode()},methods:{isStepNode({type:e}){return"step"===e},contentClass(e){return{[`interstitial interstitial-${e+1}`]:!this.isStepNode(this.content[e])}},onReverseIntoLastStep(){const{asset:e}=this.$refs;if(e){const t=e.$el.querySelector("video");t&&(t.currentTime=0,t.play().catch((()=>{})))}},onFocus(e){const{code:t,media:n,runtimePreview:s}=this.content[e];this.activeStep=e,this.visibleAsset={code:t,media:n,runtimePreview:s}},onRuntimePreviewToggle(e){this.$emit("runtime-preview-toggle",e)},findClosestStepNode(){const e=.333*window.innerHeight;let t=null,n=0;this.stepNodes.forEach((s=>{const{index:i}=s.props,r=this.$refs.contentNodes[i].$refs.step;if(!r)return;const{top:o,bottom:a}=r.getBoundingClientRect(),l=o-e,c=a-e,u=Math.abs(l+c);(0===n||u<=n)&&(n=u,t=i)})),null!==t&&this.onFocus(t)},getIntersectionTargets(){const{stepNodes:e,$refs:t}=this;return e.map((({props:{index:e}})=>t.contentNodes[e].$refs.step))},onIntersect(e){const{target:t,isIntersecting:n}=e;if(!n)return;const s=parseFloat(t.getAttribute("data-index"));this.intersectionScrollDirection===xi.down&&s===this.stepNodes[this.stepNodes.length-1].props.index&&this.onReverseIntoLastStep(),this.onFocus(s)}},props:{content:{type:Array,required:!0},isRuntimePreviewVisible:{type:Boolean,require:!0},sectionNumber:{type:Number,required:!0}}},Ii=Ti,$i=(0,w.Z)(Ii,Ps,Ds,!1,null,"e3061a7c",null),Ni=$i.exports,qi={name:"Section",components:{Intro:qs,LinkableSection:tt,Steps:Ni},computed:{introProps(){const[{content:e,media:t},...n]=this.contentSection;return{content:e,expandedSections:n,media:t,sectionAnchor:this.anchor,sectionNumber:this.sectionNumber,title:this.title}}},props:{anchor:{type:String,required:!0},title:{type:String,required:!0},contentSection:{type:Array,required:!0},stepsSection:{type:Array,required:!0},sectionNumber:{type:Number,required:!0},isRuntimePreviewVisible:{type:Boolean,required:!0}},methods:{onRuntimePreviewToggle(e){this.$emit("runtime-preview-toggle",e)}}},Pi=qi,Di=(0,w.Z)(Pi,Ss,xs,!1,null,"6b3a0b3a",null),Zi=Di.exports,Ri={name:"SectionList",components:{Section:Zi},data(){return{isRuntimePreviewVisible:!0}},props:{tasks:{type:Array,required:!0}},methods:{onRuntimePreviewToggle(e){this.isRuntimePreviewVisible=e}}},Oi=Ri,Li=(0,w.Z)(Oi,ws,ks,!1,null,"79a75e9e",null),Bi=Li.exports;const Mi={assessments:cs,hero:Sn,tasks:Bi,callToAction:Pt},Fi=new Set(Object.keys(Mi)),Vi={name:"TutorialSection",render:function(e){const{kind:t,...n}=this.section,s=Mi[t];return s?e(s,{props:n}):null},props:{section:{type:Object,required:!0,validator:e=>Fi.has(e.kind)}}};var ji={name:"Tutorial",mixins:[_e.Z],components:{NavigationBar:be,Section:Vi,PortalTarget:h.YC,BreakpointEmitter:o["default"]},inject:["isTargetIDE","store"],computed:{heroSection(){return this.sections.find((({kind:e})=>"hero"===e))},tutorialTitle(){return(this.heroSection||{}).title},pageTitle(){return this.tutorialTitle?`${this.tutorialTitle} — ${this.metadata.category} Tutorials`:void 0},pageDescription:({heroSection:e,extractFirstParagraphText:t})=>e?t(e.content):null},props:{sections:{type:Array,required:!0},references:{type:Object,required:!0},hierarchy:{type:Object,required:!0},metadata:{type:Object,required:!0},identifierUrl:{type:String,required:!0}},methods:{handleBreakpointChange(e){this.store.updateBreakpoint(e)},handleCodeColorsChange(e){_s.Z.updateCodeColors(e)}},created(){m["default"].setAvailableLocales(this.metadata.availableLocales),this.store.reset(),this.store.setReferences(this.references)},watch:{references(e){this.store.setReferences(e)},"metadata.availableLocales":function(e){m["default"].setAvailableLocales(e)}},mounted(){this.$bridge.on("codeColors",this.handleCodeColorsChange),this.$bridge.send({type:"requestCodeColors"})},beforeDestroy(){this.$bridge.off("codeColors",this.handleCodeColorsChange)}},Ei=ji,Hi=(0,w.Z)(Ei,Cs,bs,!1,null,"1631abcb",null),Ui=Hi.exports,zi=n(1789),Gi=n(5184);const Wi={article:"article",tutorial:"project"};var Qi={name:"Topic",inject:{isTargetIDE:{default:!1}},mixins:[zi.Z,Gi.Z],data(){return{topicData:null}},computed:{navigationBarHeight(){return this.isTargetIDE?0:52},store(){return u},hierarchy(){const{hierarchy:e={}}=this.topicData,{technologyNavigation:t=["overview","tutorials","resources"]}=e||{};return{...e,technologyNavigation:t}},topicKey:({$route:e,topicData:t})=>[e.path,t.identifier.interfaceLanguage].join()},beforeRouteEnter(e,t,n){e.meta.skipFetchingData?n((e=>e.newContentMounted())):(0,r.Ek)(e,t,n).then((e=>n((t=>{t.topicData=e})))).catch(n)},beforeRouteUpdate(e,t,n){(0,r.Us)(e,t)?(0,r.Ek)(e,t,n).then((e=>{this.topicData=e,n()})).catch(n):n()},created(){this.store.reset()},mounted(){this.$bridge.on("contentUpdate",this.handleContentUpdateFromBridge)},beforeDestroy(){this.$bridge.off("contentUpdate",this.handleContentUpdateFromBridge)},methods:{componentFor(e){const{kind:t}=e;return{[Wi.article]:ys,[Wi.tutorial]:Ui}[t]},propsFor(e){const{hierarchy:t,kind:n,metadata:s,references:i,sections:r,identifier:o}=e;return{[Wi.article]:{hierarchy:t,metadata:s,references:i,sections:r,identifierUrl:o.url},[Wi.tutorial]:{hierarchy:t,metadata:s,references:i,sections:r,identifierUrl:o.url}}[n]}},provide(){return{navigationBarHeight:this.navigationBarHeight,store:this.store}},watch:{topicData(){this.$nextTick((()=>{this.newContentMounted()}))}}},Ki=Qi,Xi=(0,w.Z)(Ki,s,i,!1,null,null,null),Yi=Xi.exports}}]); |