mw.loader.implement("ext.visualEditor.core.utils.parsing@yk6md",function($,jQuery,require,module){ve.isBlockElement=function(element){var elementName=typeof element==='string'?element:element.nodeName;return ve.elementTypes.block.indexOf(elementName.toLowerCase())!==-1;};ve.isVoidElement=function(element){var elementName=typeof element==='string'?element:element.nodeName;return ve.elementTypes.void.indexOf(elementName.toLowerCase())!==-1;};ve.elementTypes={block:['div','p','table','tbody','thead','tfoot','caption','th','tr','td','ul','ol','li','dl','dt','dd','h1','h2','h3','h4','h5','h6','hgroup','article','aside','body','nav','section','footer','header','figure','figcaption','fieldset','details','blockquote','hr','button','canvas','center','col','colgroup','embed','map','object','pre','progress','video'],void:['area','base','br','col','embed','hr','img','input','link','meta','param','source','track','wbr']};ve.matchTag=function(html,tag){return html.match(new RegExp('<'+tag+ '(>|\\s[^>]*>)'));};ve.addHeadTag=function(docHtml,tagHtml){function insertAfter(match,text){var offset=match.index+match[0].length;return docHtml.slice(0,offset)+text+docHtml.slice(offset);}var headMatch=ve.matchTag(docHtml,'head');if(headMatch){return insertAfter(headMatch,tagHtml);}else{var htmlMatch=ve.matchTag(docHtml,'html');if(htmlMatch){return insertAfter(htmlMatch,''+tagHtml+'');}else{return''+tagHtml+''+docHtml;}}};ve.createDocumentFromHtml=function(html){if(html!==''){if(!ve.matchTag(html,'body')){html=''+html+'';}html=ve.addHeadTag(html,'');}var newDocument=new DOMParser().parseFromString(html||'','text/html');var tmpMeta=newDocument.querySelector('meta[data-ve-tmp]');if(tmpMeta){tmpMeta.parentNode.removeChild(tmpMeta);}return newDocument;};ve.fixBase=function(targetDoc,sourceDoc,fallbackBase){var baseNode=targetDoc.getElementsByTagName('base')[0];if( baseNode){if(!targetDoc.baseURI||targetDoc.baseURI==='about:blank'){baseNode.setAttribute('href',ve.resolveUrl(baseNode.getAttribute('href'),sourceDoc));if(!targetDoc.baseURI&&fallbackBase){baseNode.setAttribute('href',fallbackBase);}}baseNode.href=baseNode.href;}else if(fallbackBase){baseNode=targetDoc.createElement('base');baseNode.setAttribute('href',fallbackBase);targetDoc.head.appendChild(baseNode);}};ve.properInnerHtml=function(element){return ve.fixupPreBug(element).innerHTML;};ve.properOuterHtml=function(element){return ve.fixupPreBug(element).outerHTML;};ve.fixupPreBug=function(element){if(ve.isPreInnerHtmlBroken===undefined){var div=document.createElement('div');div.innerHTML='
\n\n
';ve.isPreInnerHtmlBroken=div.innerHTML==='
\n
';}if(!ve.isPreInnerHtmlBroken){return element;}var $element=$(element).clone();$element.find('pre, textarea, listing').each(function(){var matches;if(this.firstChild&&this.firstChild.nodeType===Node.TEXT_NODE){matches=this. firstChild.data.match(/^(\r\n|\r|\n)/);if(matches&&matches[1]){this.firstChild.insertData(0,matches[1]);}}});return $element.get(0);};ve.normalizeAttributeValue=function(name,value,nodeName){var node=document.createElement(nodeName||'div');node.setAttribute(name,value);return node.getAttribute(name)||'';};ve.transformStyleAttributes=function(html,unmask){var maskAttrs=['style','bgcolor','color','width','height','rowspan','colspan'];var xmlDoc=new DOMParser().parseFromString(html,'text/xml');for(var i=0,len=maskAttrs.length;i').addClass('ve-init-mw-desktopArticleTarget-loading-overlay').append(init.progressBar.$element);}$(document).on('keydown',onDocumentKeyDown);$toolbarPlaceholderBar.append(init.$loading);}function incrementLoadingProgress(){init.progressBar.incrementLoadingProgress();}function clearLoading(){init.progressBar.clearLoading();isLoading=false;$(document).off('keydown',onDocumentKeyDown);$('html').removeClass('ve-loading');if(init.$loading){init.$loading.detach();}if(tempWikitextEditor){teardownTempWikitextEditor();}hideToolbarPlaceholder();}function onWindowScroll(){var scrollTop=$(document.documentElement).scrollTop();var floating=scrollTop>contentTop;if(floating!==wasFloating){var width=$targetContainer.outerWidth();$toolbarPlaceholder.toggleClass('ve-init-mw-desktopArticleTarget-toolbarPlaceholder-floating',floating);$toolbarPlaceholderBar.css('width',width);wasFloating=floating;}}var onWindowScrollListener=mw.util.throttle(onWindowScroll,250); function showToolbarPlaceholder(){if(!$toolbarPlaceholder){$toolbarPlaceholder=$('
').addClass('ve-init-mw-desktopArticleTarget-toolbarPlaceholder');$toolbarPlaceholderBar=$('
').addClass('ve-init-mw-desktopArticleTarget-toolbarPlaceholder-bar');$toolbarPlaceholder.append($toolbarPlaceholderBar);}contentTop=$targetContainer.offset().top;wasFloating=null;onWindowScroll();var scrollTopBefore=$(document.documentElement).scrollTop();$targetContainer.prepend($toolbarPlaceholder);$(window).on('scroll',onWindowScrollListener);if(wasFloating){window.scrollTo(0,scrollTopBefore+$toolbarPlaceholder.outerHeight());}setTimeout(function(){$toolbarPlaceholder.addClass('ve-init-mw-desktopArticleTarget-toolbarPlaceholder-open');});}function hideToolbarPlaceholder(){if($toolbarPlaceholder){$(window).off('scroll',onWindowScrollListener);$toolbarPlaceholder.detach();$toolbarPlaceholder.removeClass('ve-init-mw-desktopArticleTarget-toolbarPlaceholder-open');}}function setupTempWikitextEditor(data){ var wikitext=data.content;if(wikitext){wikitext+='\n';}tempWikitextEditor=new mw.libs.ve.MWTempWikitextEditorWidget({value:wikitext});tempWikitextEditorData=data;$('#firstHeading').addClass('ve-init-mw-desktopArticleTarget-uneditableContent');$('#mw-content-text').before(tempWikitextEditor.$element).addClass('oo-ui-element-hidden');$('html').addClass('ve-tempSourceEditing').removeClass('ve-loading');tempWikitextEditor.adjustSize().moveCursorToStart();ve.track('mwedit.ready',{mode:'source',platform:'desktop'});mw.libs.ve.tempWikitextEditor=tempWikitextEditor;mw.hook('ve.wikitextInteractive').fire();}function syncTempWikitextEditor(){var wikitext=tempWikitextEditor.getValue();if(wikitext.slice(-1)==='\n'){wikitext=wikitext.slice(0,-1);}if(wikitext!==tempWikitextEditorData.content){tempWikitextEditorData.content=wikitext;tempWikitextEditorData.fromEditedState=true;}tempWikitextEditorData.initialSourceRange=tempWikitextEditor.getRange();tempWikitextEditor.$element.prop('readonly',true);} function teardownTempWikitextEditor(){tempWikitextEditor.$element.remove();mw.libs.ve.tempWikitextEditor=tempWikitextEditor=null;tempWikitextEditorData=null;$('#mw-content-text').removeClass('oo-ui-element-hidden');$('html').removeClass('ve-tempSourceEditing');}function abortLoading(){$('html').removeClass('ve-activated');active=false;updateTabs(false);if(history.pushState&&$('#ca-view a').length){history.pushState({tag:'visualeditor'},'',new mw.Uri($('#ca-view a').attr('href')));}clearLoading();}function onDocumentKeyDown(e){if(e.which===27){abortLoading();e.preventDefault();}}function parseSection(section){if(section&&/^(new|\d+|T-\d+)$/.test(section)){return section;}return null;}function getTarget(mode,section){if(!targetPromise){targetPromise=mw.loader.using('ext.visualEditor.targetLoader').then(function(){mw.libs.ve.targetLoader.addPlugin(function(){return mw.loader.using(conf.preloadModules).catch(function(){return $.Deferred().resolve();});});[ 'ext.visualEditor.desktopArticleTarget'].concat(plugins).forEach(mw.libs.ve.targetLoader.addPlugin);plugins=[];return mw.libs.ve.targetLoader.loadModules(mode);}).then(function(){if(!active){targetPromise=null;return $.Deferred().reject().promise();}var target=ve.init.mw.targetFactory.create(conf.contentModels[mw.config.get('wgPageContentModel')],{modes:availableModes,defaultMode:mode});target.on('deactivate',function(){active=false;updateTabs(false);});target.on('reactivate',function(){try{uri=new mw.Uri(null,{arrayParams:true});}catch(e){uri=viewUri;}activateTarget(getEditModeFromUri(uri),parseSection(uri.query.section));});target.setContainer($targetContainer);targetLoaded=true;return target;},function(e){mw.log.warn('VisualEditor failed to load: '+e);});}targetPromise.then(function(target){target.section=section;});return targetPromise;}function trackActivateStart(initData,link){if(link){link=new mw.Uri($(link).closest('a').attr('href'));}else{link=uri;}if(link&&link.query.wvprov ==='sticky-header'){initData.mechanism+='-sticky-header';}ve.track('trace.activate.enter',{mode:initData.mode});initData.platform='desktop';ve.track('mwedit.init',initData);mw.libs.ve.activationStart=ve.now();}function getTabMessage(key){var tabMsgKey=tabMessages[key];if(!tabMsgKey&&(key==='edit'||key==='create')){tabMsgKey=mw.config.get('skin')+'-view-'+key;if(!mw.message(tabMsgKey).exists()){tabMsgKey='skin-view-'+key;}}return mw.msg(tabMsgKey);}function setEditorPreference(editor){if(!init.isVisualAvailable||(conf.disableForAnons&&mw.config.get('wgUserName')===null)){return $.Deferred().resolve().promise();}if(editor!=='visualeditor'&&editor!=='wikitext'){throw new Error('setEditorPreference called with invalid option: ',editor);}var key=pageExists?'edit':'create',sectionKey='editsection';if(mw.config.get('wgVisualEditorConfig').singleEditTab&&tabPreference==='remember-last'){if($('#ca-view-foreign').length){key+='localdescription';}if(editor==='wikitext'){key+='source';sectionKey+= 'source';}$('#ca-edit a').text(getTabMessage(key));$('.mw-editsection a').text(getTabMessage(sectionKey));}mw.cookie.set('VEE',editor,{path:'/',expires:30*86400,prefix:''});if(!mw.user.isAnon()&&mw.user.options.get('visualeditor-editor')!==editor){return new mw.Api().saveOption('visualeditor-editor',editor).then(function(){mw.user.options.set('visualeditor-editor',editor);});}return $.Deferred().resolve().promise();}function updateTabs(editing,mode,isNewSection){var $tab;if(editing){if(isNewSection){$tab=$('#ca-addsection');}else if($('#ca-ve-edit').length){if(!mode||mode==='visual'){$tab=$('#ca-ve-edit');}else{$tab=$('#ca-edit');}}else{$tab=$('#ca-edit');}}else{$tab=$('#ca-view');}$('#p-views').find('li.selected').removeClass('selected');$('#ca-edit, #ca-ve-edit, #ca-addsection').not($tab).removeClass('selected');$tab.addClass('selected');}function scrollToSection(section){if(section==='0'||section==='new'){return;}var $heading;$( '#mw-content-text .mw-editsection a:not( .mw-editsection-visualeditor )').each(function(){var linkUri=new mw.Uri(this.href);if(section===parseSection(linkUri.query.section)){$heading=$(this).closest('h1, h2, h3, h4, h5, h6');return false;}});if(!$heading||!$heading.length){return;}var offset=0;var enableVisualSectionEditing=mw.config.get('wgVisualEditorConfig').enableVisualSectionEditing;if(enableVisualSectionEditing===true||enableVisualSectionEditing==='desktop'){offset=$('#mw-content-text').offset().top;}else{offset=parseInt($heading.css('margin-top'));}var supportsSmoothScroll='scrollBehavior'in document.documentElement.style;var newScrollTop=$heading.offset().top-offset-$toolbarPlaceholder.outerHeight();if(supportsSmoothScroll){window.scroll({top:newScrollTop,behavior:'smooth'});}else{var scrollContainer=document.documentElement;$(scrollContainer).animate({scrollTop:newScrollTop});}}function activateTarget(mode,section,tPromise,modified){var dataPromise;updateTabs(true,mode,section ==='new');if(!targetLoaded){dataPromise=mw.loader.using('ext.visualEditor.targetLoader').then(function(){return mw.libs.ve.targetLoader.requestPageData(mode,mw.config.get('wgRelevantPageName'),{sessionStore:true,section:section,oldId:oldId,targetName:'mwTarget',modified:modified,editintro:uri.query.editintro,preload:uri.query.preload,preloadparams:uri.query.preloadparams,wikitext:mode==='visual'&&modified?$('#wpTextbox1').textSelection('getContents'):undefined});});dataPromise.then(function(response){if(isLoading&&mode==='source'&§ion!=='new'&&!(response.visualeditor&&response.visualeditor.recovered)){setupTempWikitextEditor(response.visualeditor);}}).then(incrementLoadingProgress);}showToolbarPlaceholder();mw.hook('ve.activationStart').fire();var visibleSection=null;var visibleSectionOffset=null;if(section===null){var firstVisibleEditSection=null;$('#firstHeading, #mw-content-text .mw-editsection').each(function(){var top=this.getBoundingClientRect().top;if(top>0){ firstVisibleEditSection=this;return false;}});if(firstVisibleEditSection&&firstVisibleEditSection.id!=='firstHeading'){var firstVisibleSectionLink=firstVisibleEditSection.querySelector('a');var linkUri=new mw.Uri(firstVisibleSectionLink.href);visibleSection=parseSection(linkUri.query.section);var firstVisibleHeading=$(firstVisibleEditSection).closest('h1, h2, h3, h4, h5, h6')[0];visibleSectionOffset=firstVisibleHeading.getBoundingClientRect().top;}}else if(mode==='visual'){scrollToSection(section);}showLoading(mode);incrementLoadingProgress();active=true;tPromise=tPromise||getTarget(mode,section);tPromise.then(function(target){target.visibleSection=visibleSection;target.visibleSectionOffset=visibleSectionOffset;incrementLoadingProgress();target.setDefaultMode(mode);if(tempWikitextEditor){syncTempWikitextEditor();}var deactivating=target.deactivatingDeferred||$.Deferred().resolve();return deactivating.then(function(){var activatePromise=target.activate(dataPromise);target. toolbarSetupDeferred.done(function(){hideToolbarPlaceholder();});return activatePromise;});}).then(function(){if(mode==='visual'){ve.track('mwedit.ready',{mode:mode});}else if(!tempWikitextEditor){ve.track('mwedit.ready',{mode:mode});mw.hook('ve.wikitextInteractive').fire();}ve.track('mwedit.loaded',{mode:mode});}).always(clearLoading);}function activatePageTarget(mode,section,modified,link){trackActivateStart({type:'page',mechanism:mw.config.get('wgArticleId')?'click':'new',mode:mode},link);if(!active){if(uri.query.action!=='edit'&&!(uri.query.veaction in veactionToMode)){if(history.pushState){history.replaceState({tag:'visualeditor'},'',uri);history.pushState({tag:'visualeditor'},'',mode==='source'?veEditSourceUri:veEditUri);}uri=veEditUri;}activateTarget(mode,section,undefined,modified);}}function getLastEditor(){var editor=mw.cookie.get('VEE','');if(!mw.user.isAnon()||!editor||!(editor==='visualeditor'||editor==='wikitext')){editor=mw.user.options.get('visualeditor-editor');}return editor ;}function getEditPageEditor(){var isRedLink=!!+uri.query.redlink;if(!mw.config.get('wgVisualEditorConfig').singleEditTab&&!isRedLink){return'wikitext';}switch(tabPreference){case'prefer-ve':return'visualeditor';case'prefer-wt':return'wikitext';case'multi-tab':return isRedLink?getLastEditor():'wikitext';case'remember-last':default:return getLastEditor();}}function getAvailableEditPageEditor(){switch(getEditPageEditor()){case'visualeditor':if(init.isVisualAvailable){return'visual';}if(init.isWikitextAvailable){return'source';}return null;case'wikitext':default:return init.isWikitextAvailable?'source':null;}}function checkPreferenceOrStorage(prefName,storageKey,cookieName){storageKey=storageKey||prefName;cookieName=cookieName||storageKey;return mw.user.options.get(prefName)||(mw.user.isAnon()&&(mw.storage.get(storageKey)||mw.cookie.get(cookieName,'')));}function setPreferenceOrStorage(prefName,storageKey,cookieName){storageKey=storageKey||prefName;cookieName=cookieName||storageKey;if(mw. user.isAnon()){if(!mw.storage.set(storageKey,1)){mw.cookie.set(cookieName,1,{path:'/',expires:30*86400,prefix:''});}}else{new mw.Api().saveOption(prefName,'1');mw.user.options.set(prefName,'1');}}conf=mw.config.get('wgVisualEditorConfig');tabMessages=conf.tabMessages;viewUri=new mw.Uri(mw.util.getUrl(mw.config.get('wgRelevantPageName')));try{uri=new mw.Uri(null,{arrayParams:true});}catch(e){uri=viewUri;}oldId=mw.config.get('wgRevisionId')||$('input[name=parentRevId]').val();if(oldId===mw.config.get('wgCurRevisionId')||mw.config.get('wgFlaggedRevsEditLatestRevision')){oldId=undefined;}pageExists=!!mw.config.get('wgRelevantArticleId');var isViewPage=mw.config.get('wgIsArticle')&&!('diff'in uri.query);var isEditPage=mw.config.get('wgAction')==='edit'||mw.config.get('wgAction')==='submit';var pageCanLoadEditor=isViewPage||isEditPage;var pageIsProbablyEditable=mw.config.get('wgIsProbablyEditable')||mw.config.get('wgRelevantPageIsProbablyEditable');if(pageCanLoadEditor){$targetContainer. addClass('ve-init-mw-desktopArticleTarget-targetContainer');}var enable=!!+mw.user.options.get('visualeditor-enable');var tempdisable=!!+mw.user.options.get('visualeditor-betatempdisable');var autodisable=!!+mw.user.options.get('visualeditor-autodisable');tabPreference=mw.user.options.get('visualeditor-tabs');function isOnlyTabVE(){return conf.singleEditTab&&getAvailableEditPageEditor()==='visual';}function isOnlyTabWikitext(){return conf.singleEditTab&&getAvailableEditPageEditor()==='source';}init={unsupportedList:conf.unsupportedList,addPlugin:function(plugin){plugins.push(plugin);},setupEditLinks:function(){if(init.isWikitextAvailable&&!isOnlyTabVE()){$('.mw-editsection a:not( .mw-editsection-visualeditor ),'+'#ca-edit a,'+'#ca-addsection a').each(function(){var linkUri;try{linkUri=new mw.Uri(this.href);}catch(e){return;}if('action'in linkUri.query){delete linkUri.query.action;linkUri.query.veaction='editsource';$(this).attr('href',linkUri.toString());}});}if(init.isAvailable){if(! init.isSingleEditTab&&init.isVisualAvailable&&!(conf.disableForAnons&&mw.config.get('wgUserName')===null)){init.setupMultiTabSkin();}else if(pageCanLoadEditor&&((init.isVisualAvailable&&isOnlyTabVE())||(init.isWikitextAvailable&&isOnlyTabWikitext()))){$('.mw-editsection a').off('.ve-target').on('click.ve-target',function(e){init.onEditSectionLinkClick(isOnlyTabVE()?'visual':'source',e);});$('#ca-edit').off('.ve-target').on('click.ve-target',function(e){init.onEditTabClick(isOnlyTabVE()?'visual':'source',e);});}}},setupMultiTabSkin:function(){init.setupMultiTabs();init.setupMultiSectionLinks();},setupMultiTabs:function(){var action=pageExists?'edit':'create',isMinerva=mw.config.get('skin')==='minerva',pTabsId=isMinerva?'page-actions':$('#p-views').length?'p-views':'p-cactions',$caSource=$('#ca-viewsource');$caEdit=$('#ca-edit, #page-actions-edit');$caVeEdit=$('#ca-ve-edit');$caEditLink=$caEdit.find('a'),$caVeEditLink=$caVeEdit.find('a'),caVeEditNextnode=(conf.tabPosition==='before')? $caEdit.get(0):$caEdit.next().get(0);if(!$caVeEdit.length){if($('#ca-view-foreign').length){if(tabMessages[action+'localdescriptionsource']){$caEditLink.text(mw.msg(tabMessages[action+'localdescriptionsource']));}}else{if(tabMessages[action+'source']){$caEditLink.text(mw.msg(tabMessages[action+'source']));}}if($caEdit.length&&!$caSource.length){var caVeEdit=mw.util.addPortletLink(pTabsId,veEditUri,getTabMessage(action),'ca-ve-edit',mw.msg('tooltip-ca-ve-edit'),mw.msg('accesskey-ca-ve-edit'),caVeEditNextnode);$caVeEdit=$(caVeEdit);if(isMinerva){$caVeEdit.find('.mw-ui-icon').addClass('mw-ui-icon-wikimedia-edit-base20');}}}else if($caEdit.length&&$caVeEdit.length){if(conf.tabPosition==='before'){if($caEdit.next()[0]===$caVeEdit[0]){$caVeEdit.after($caEdit);}}else{if($caVeEdit.next()[0]===$caEdit[0]){$caEdit.after($caVeEdit);}}$caVeEditLink.text(getTabMessage(action));}if(!(init.isVisualAvailable)){$caVeEdit.remove();}else if(pageCanLoadEditor){$caVeEdit.off('.ve-target').on( 'click.ve-target',init.onEditTabClick.bind(init,'visual'));const pageSideEdit=$('.page-side-edit');if(pageSideEdit.length){if(pageSideEdit[0].href.includes('veaction')){$('.page-side-edit').off('.ve-target').on('click.ve-target',init.onEditTabClick.bind(init,'visual'));}else{$('.page-side-edit').off('.ve-target').on('click.ve-target',init.onEditTabClick.bind(init,'source'));}}$('.mw-editsection a:not(.mw-editsection-visualeditor)').off('.ve-target').on('click.ve-target',init.onEditSectionLinkClick.bind(init,'source'));const wrapperNode=document.querySelector('.highlight__actions');const config={childList:true};mutationObserver=new MutationObserver((mutationsList,observer)=>{mutationsList.forEach((mutation)=>{if(mutation.type==='childList'&&mutation.addedNodes.length>0){const addedNode=mutation.addedNodes[0];if(addedNode&&addedNode.querySelector('[data-testid="highlight-action_edit-section"]')){this.preloadModules();const editButton=addedNode.querySelector( '[data-testid="highlight-action_edit-section"]');if(pageSideEdit.length){if(pageSideEdit[0].href.includes('veaction')){editButton.addEventListener('click',init.onEditTabClick.bind(init,'visual'));}else{editButton.addEventListener('click',init.onEditTabClick.bind(init,'source'));}}}}});});if(wrapperNode){mutationObserver.observe(wrapperNode,config);}$caEdit.on('mouseover.ve-target-source',this.preloadModules.bind(this));$caVeEdit.on('mouseover.ve-target',this.preloadModules.bind(this));$('.mw-editsection').on('mouseover.ve-target-section',this.preloadModules.bind(this));$('.page-side-edit').on('mouseover.ve-target-float',this.preloadModules.bind(this));}if(pageCanLoadEditor){$caEdit.off('.ve-target').on('click.ve-target',init.onEditTabClick.bind(init,'source'));}if(pageCanLoadEditor&&init.isWikitextAvailable){$('#ca-addsection').off('.ve-target').on('click.ve-target',init.onEditTabClick.bind(init,'source'));}if(isMinerva){mw.loader.load(['oojs-ui.styles.icons-editing-advanced', 'oojs-ui.styles.icons-accessibility']);$caEdit.find('.mw-ui-icon').each(function(){var $icon=$('').addClass('mw-ui-icon mw-ui-icon-element mw-ui-icon-wikiText');$(this).addClass('ve-edit-source').prepend($icon);});$caVeEdit.find('.mw-ui-icon').each(function(){var $icon=$('').addClass('mw-ui-icon mw-ui-icon-element mw-ui-icon-eye');$(this).addClass('ve-edit-visual').prepend($icon);});}if(init.isVisualAvailable){if(conf.tabPosition==='before'){$caEdit.addClass('collapsible');}else{$caVeEdit.addClass('collapsible');}}},preloadModules:function(){mw.loader.using(['ext.visualEditor.switching','ext.visualEditor.articleTarget','ext.visualEditor.core.desktop']);},setupMultiSectionLinks:function(){var $editsections=$('#mw-content-text .mw-editsection'),bodyDir=$(document.body).css('direction');if($editsections.css('direction')!==bodyDir){$editsections.css('direction',bodyDir);}var isMinerva=mw.config.get('skin')==='minerva';if($editsections.find('.mw-editsection-visualeditor').length===0){ $editsections.each(function(){var $editsection=$(this),$editSourceLink=$editsection.find('a').eq(0),$editLink=$editSourceLink.clone(),$divider=$(''),dividerText=mw.msg('pipe-separator');$editSourceLink.text(mw.msg(tabMessages.editsectionsource));$editLink.text(mw.msg(tabMessages.editsection));$divider.addClass('mw-editsection-divider').text(dividerText);if(!$('#ca-view-foreign').length){$editLink.attr('href',function(i,href){var veUri=new mw.Uri(veEditUri);veUri.query.section=(new mw.Uri(href)).query.section;return veUri.toString();}).addClass('mw-editsection-visualeditor');if(conf.tabPosition==='before'){$editSourceLink.before($editLink,$divider);if(isMinerva){$editLink.removeClass('mw-ui-icon-flush-right');}}else{$editSourceLink.after($divider,$editLink);if(isMinerva){$editSourceLink.removeClass('mw-ui-icon-flush-right');}}}});}if(isMinerva){mw.loader.load(['oojs-ui.styles.icons-editing-advanced','oojs-ui.styles.icons-accessibility']);$( '#mw-content-text .mw-editsection a:not(.mw-editsection-visualeditor)').each(function(){var $icon=$('').addClass('mw-ui-icon mw-ui-icon-element mw-ui-icon-wikiText');$(this).addClass('ve-edit-source').prepend($icon);});$('#mw-content-text .mw-editsection a.mw-editsection-visualeditor').each(function(){var $icon=$('').addClass('mw-ui-icon mw-ui-icon-element mw-ui-icon-eye');$(this).addClass('ve-edit-visual').prepend($icon);});}if(pageCanLoadEditor){$editsections.find('.mw-editsection-visualeditor').off('.ve-target').on('click.ve-target',init.onEditSectionLinkClick.bind(init,'visual'));if(init.isWikitextAvailable){$editsections.find('a:not( .mw-editsection-visualeditor )').off('.ve-target').on('click.ve-target',init.onEditSectionLinkClick.bind(init,'source'));}}},isUnmodifiedLeftClick:function(e){return e&&((e.which&&e.which===1&&!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey))||e.isTrigger);},onEditTabClick:function(mode,e){if(!init.isUnmodifiedLeftClick(e)){return;}if(!active&&mode ==='source'&&!init.isWikitextAvailable){return;}e.preventDefault();if(isLoading){return;}var section=$(e.target).closest('#ca-addsection').length?'new':null;if(active){targetPromise.done(function(target){if(target.getDefaultMode()==='source'){if(mode==='visual'){target.switchToVisualEditor();}else if(mode==='source'){target.switchToWikitextSection(section);}}else if(target.getDefaultMode()==='visual'){if(mode==='source'){if(section){target.switchToWikitextSection(section);}else{target.editSource();}}}});}else{if(section!==null){this.onEditSectionLinkClick(mode,e,section);}else{init.activateVe(mode,e.target);}}},activateVe:function(mode,link){var wikitext=$('#wpTextbox1').textSelection('getContents'),sectionVal=$('input[name=wpSection]').val(),section=sectionVal!==''&§ionVal!==undefined?sectionVal:null,config=mw.config.get('wgVisualEditorConfig'),canSwitch=config.fullRestbaseUrl||config.allowLossySwitching,modified=mw.config.get('wgAction')==='submit'||(mw.config.get('wgAction')=== 'edit'&&wikitext!==initialWikitext);if($.fn.dialog){$('.ui-dialog-content').dialog('close');}function releaseOldEditWarning(){$(window).off('beforeunload.editwarning');}if(modified&&!canSwitch){mw.loader.using('ext.visualEditor.switching').done(function(){var windowManager=new OO.ui.WindowManager(),switchWindow=new mw.libs.ve.SwitchConfirmDialog();$(document.body).append(windowManager.$element);windowManager.addWindows([switchWindow]);windowManager.openWindow(switchWindow).closed.then(function(data){var oldUri;if(data&&data.action==='discard'){releaseOldEditWarning();setEditorPreference('visualeditor');oldUri=veEditUri.clone();delete oldUri.query.veswitched;location.href=oldUri.extend({wteswitched:1});}});});}else{releaseOldEditWarning();activatePageTarget(mode,section,modified,link);}},onEditSectionLinkClick:function(mode,e,section){var linkUri=new mw.Uri(e.currentTarget.href),title=mw.Title.newFromText(linkUri.query.title||'');if(!init.isUnmodifiedLeftClick(e)||!('veaction'in linkUri .query)||linkUri.getHostPort()!==location.host||title&&title.getPrefixedText()!==new mw.Title(mw.config.get('wgRelevantPageName')).getPrefixedText()){return;}e.preventDefault();if(isLoading){return;}trackActivateStart({type:'section',mechanism:section==='new'?'new':'click',mode:mode},e.target);if(!active){if(uri.query.action!=='edit'&&!(uri.query.veaction in veactionToMode)){if(history.pushState){history.replaceState({tag:'visualeditor'},'',uri);history.pushState({tag:'visualeditor'},'',linkUri);}}uri=linkUri;if(section===undefined){section=parseSection(linkUri.query.section);}var tPromise=getTarget(mode,section);activateTarget(mode,section,tPromise,e.target);}},shouldShowWelcomeDialog:function(){return!(!mw.config.get('wgVisualEditorConfig').showBetaWelcome||this.isWelcomeDialogSuppressed()||checkPreferenceOrStorage('visualeditor-hidebetawelcome','ve-beta-welcome-dialog'));},isWelcomeDialogSuppressed:function(){return!!(welcomeDialogDisabled||'vehidebetadialog'in new mw.Uri().query|| 'hidewelcomedialog'in new mw.Uri().query);},stopShowingWelcomeDialog:function(){setPreferenceOrStorage('visualeditor-hidebetawelcome','ve-beta-welcome-dialog');},disableWelcomeDialog:function(){welcomeDialogDisabled=true;},shouldShowEducationPopups:function(){return!(educationPopupsDisabled||checkPreferenceOrStorage('visualeditor-hideusered','ve-hideusered'));},stopShowingEducationPopups:function(){setPreferenceOrStorage('visualeditor-hideusered','ve-hideusered');},disableEducationPopups:function(){educationPopupsDisabled=true;}};init.isSingleEditTab=conf.singleEditTab&&tabPreference!=='multi-tab';var veEditBaseUri=pageCanLoadEditor?uri:viewUri;if(init.isSingleEditTab){veEditSourceUri=veEditUri=veEditBaseUri.clone().extend({action:'edit'});delete veEditUri.query.veaction;}else{veEditUri=veEditBaseUri.clone().extend({veaction:'edit'});veEditSourceUri=veEditBaseUri.clone().extend({veaction:'editsource'});delete veEditUri.query.action;delete veEditSourceUri.query.action;}if(oldId){ veEditUri.extend({oldid:oldId});}init.isAvailable=(VisualEditorSupportCheck()&&(('vesupported'in uri.query)||!$.client.test(init.unsupportedList,null,true)));var enabledForUser=((conf.isBeta?enable:!tempdisable)&&!autodisable);init.isVisualAvailable=(init.isAvailable&&(uri.query.veaction==='edit'||(conf.namespaces.indexOf(new mw.Title(mw.config.get('wgRelevantPageName')).getNamespaceId())!==-1&&enabledForUser))&&Object.prototype.hasOwnProperty.call(conf.contentModels,mw.config.get('wgPageContentModel')));init.isWikitextAvailable=(init.isAvailable&&conf.enableWikitext&&mw.user.options.get('visualeditor-newwikitext')&&mw.config.get('wgPageContentModel')==='wikitext');if(init.isVisualAvailable){availableModes.push('visual');}if(init.isWikitextAvailable){availableModes.push('source');}init.setEditorPreference=setEditorPreference;init.updateTabs=updateTabs;mw.libs.ve=$.extend(mw.libs.ve||{},init);if(init.isVisualAvailable){$('html').addClass('ve-available');}else{$('html').addClass( 've-not-available');}function isSupportedEditPage(editUri){return configData.unsupportedEditParams.every(function(param){return editUri.query[param]===undefined;});}function getEditModeFromUri(editUri){if(mw.config.get('wgDiscussionToolsStartNewTopicTool')){return false;}var m=veactionToMode[editUri.query.veaction];if(isViewPage&&init.isAvailable&&availableModes.indexOf(m)!==-1){return m;}if(isEditPage&&isSupportedEditPage(editUri)){if(editUri.query.wteswitched==='1'){return init.isVisualAvailable?'visual':null;}if(!enabledForUser||$('#ca-viewsource').length||mw.config.get('wgAction')==='submit'){return null;}return getAvailableEditPageEditor();}return null;}$(function(){var showWikitextWelcome=true,section=parseSection(uri.query.section);var requiredSkinElements=$targetContainer.length&&$('#mw-content-text').length&&(isEditPage||$('#ca-edit, #ca-viewsource').length);if(uri.query.action==='edit'&&$('#wpTextbox1').length){initialWikitext=$('#wpTextbox1').textSelection('getContents');}if ((init.isVisualAvailable||init.isWikitextAvailable)&&pageCanLoadEditor&&pageIsProbablyEditable&&!requiredSkinElements){mw.log.warn('Your skin is incompatible with VisualEditor. '+'See https://www.mediawiki.org/wiki/Extension:VisualEditor/Skin_requirements for the requirements.');var errorCode=[init.isVisualAvailable,init.isWikitextAvailable,pageCanLoadEditor,pageIsProbablyEditable,requiredSkinElements].map(function(bool){return Number(bool);}).join('-');var err=new Error('Incompatible with VisualEditor: '+errorCode);err.name='VeIncompatibleSkinWarning';mw.errorLogger.logError(err,'error.visualeditor');}else if(init.isAvailable){var mode=getEditModeFromUri(uri);if(mode){showWikitextWelcome=false;trackActivateStart({type:section===null?'page':'section',mechanism:(section==='new'||!mw.config.get('wgArticleId'))?'url-new':'url',mode:mode});activateTarget(mode,section);}else if(init.isVisualAvailable&&pageCanLoadEditor&&init.isSingleEditTab){$(document.body).append($('').attr({accesskey: mw.msg('accesskey-ca-ve-edit'),href:veEditUri}).on('click.ve-target',init.onEditTabClick.bind(init,'visual')).addClass('oo-ui-element-hidden'));}if(init.isVisualAvailable&&isEditPage&&$('#wpTextbox1').length){mw.loader.load('ext.visualEditor.switching');$('#wpTextbox1').on('wikiEditor-toolbar-doneInitialSections',function(){mw.loader.using('ext.visualEditor.switching').done(function(){var windowManager,editingTabDialog,switchToolbar,popup,showPopup=!!uri.query.veswitched&&!mw.user.options.get('visualeditor-hidesourceswitchpopup'),toolFactory=new OO.ui.ToolFactory(),toolGroupFactory=new OO.ui.ToolGroupFactory();toolFactory.register(mw.libs.ve.MWEditModeVisualTool);toolFactory.register(mw.libs.ve.MWEditModeSourceTool);switchToolbar=new OO.ui.Toolbar(toolFactory,toolGroupFactory,{classes:['ve-init-mw-editSwitch']});switchToolbar.on('switchEditor',function(m){if(m==='visual'){init.activateVe('visual');$('#wpTextbox1').trigger('wikiEditor-switching-visualeditor');}});switchToolbar.setup([{ name:'editMode',type:'list',icon:'edit',title:mw.msg('visualeditor-mweditmode-tooltip'),label:mw.msg('visualeditor-mweditmode-tooltip'),invisibleLabel:true,include:['editModeVisual','editModeSource']}]);popup=new mw.libs.ve.SwitchPopupWidget('source');switchToolbar.tools.editModeVisual.toolGroup.$element.append(popup.$element);switchToolbar.emit('updateState');$('.wikiEditor-ui-toolbar').prepend(switchToolbar.$element);popup.toggle(showPopup);if($('#ca-edit').hasClass('visualeditor-showtabdialog')){$('#ca-edit').removeClass('visualeditor-showtabdialog');windowManager=new OO.ui.WindowManager();$(document.body).append(windowManager.$element);editingTabDialog=new mw.libs.ve.EditingTabDialog();windowManager.addWindows([editingTabDialog]);windowManager.openWindow(editingTabDialog).closed.then(function(data){windowManager.destroy();if(data&&data.action==='prefer-ve'){location.href=veEditUri;}else if(data&&data.action==='multi-tab'){location.reload();}});}});});mw.libs.ve.setEditorPreference( 'wikitext');mw.storage.session.remove('ve-docstate');}init.setupEditLinks();}if(pageCanLoadEditor&&showWikitextWelcome&&(init.isVisualAvailable||init.isWikitextAvailable||$('#wpTextbox1').length)&&isEditPage&&init.shouldShowWelcomeDialog()&&pageIsProbablyEditable){mw.loader.using('ext.visualEditor.welcome').done(function(){var windowManager,welcomeDialog;if(!init.shouldShowWelcomeDialog()){return;}windowManager=new OO.ui.WindowManager();welcomeDialog=new mw.libs.ve.WelcomeDialog();$(document.body).append(windowManager.$element);windowManager.addWindows([welcomeDialog]);windowManager.openWindow(welcomeDialog,{switchable:init.isVisualAvailable,editor:'source'}).closed.then(function(data){windowManager.destroy();if(data&&data.action==='switch-ve'){init.activateVe('visual');}});init.stopShowingWelcomeDialog();if(mutationObserver){mutationObserver.detach();}});}if(uri.query.venotify){var notify=uri.query.venotify;mw.config.set('wgPostEdit',notify);mw.loader.load( 'mediawiki.action.view.postEdit');var messageSuffix;if(notify==='saved'){messageSuffix=mw.config.get('wgEditSubmitButtonLabelPublish')?'published':'saved';}else{messageSuffix=notify;}mw.hook('postEdit').fire({message:mw.msg('postedit-confirmation-'+messageSuffix,mw.user)});delete uri.query.venotify;if(history.replaceState){history.replaceState(null,'',uri);}}});}());},"modules/ve-mw/preinit/data.json":{"unsupportedEditParams":["undo","undoafter","preview","veswitched"]}}},{"css":[ ".ve-active .ve-init-mw-desktopArticleTarget-editableContent #toc,.ve-active #siteNotice,.ve-active .mw-indicators,.ve-active #t-print,.ve-active #t-permalink,.ve-active #p-coll-print_export,.ve-active #t-cite,.ve-active .ve-init-mw-desktopArticleTarget-editableContent,.ve-active .ve-init-mw-tempWikitextEditorWidget{display:none}.ve-deactivating .ve-ui-surface{display:none}.ve-activating{ }.ve-activating .ve-ui-surface{height:0;padding:0 !important; overflow:hidden} .ve-loading .ve-init-mw-desktopArticleTarget-targetContainer \u003E :not(.ve-init-mw-desktopArticleTarget-toolbarPlaceholder):not(.ve-init-mw-desktopArticleTarget),.ve-loading .ve-init-mw-desktopArticleTarget-originalContent,.ve-activated:not(.ve-loading) .ve-init-mw-desktopArticleTarget-uneditableContent{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0.5}.ve-activated .ve-init-mw-desktopArticleTarget-targetContainer #firstHeading{ -webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;pointer-events:auto;cursor:text}.ve-activated .ve-init-mw-desktopArticleTarget-targetContainer #firstHeading a{ pointer-events:none}.ve-activated .ve-init-mw-desktopArticleTarget-originalContent #catlinks{cursor:pointer}.ve-activated .ve-init-mw-desktopArticleTarget-originalContent #catlinks:hover{ background:#e9f2fd}.ve-activated .ve-init-mw-desktopArticleTarget-originalContent #catlinks a{opacity:1} .ve-init-mw-desktopArticleTarget-loading-overlay{z-index:2;position:absolute;width:100%;top:1em}.ve-init-mw-desktopArticleTarget-toolbarPlaceholder{overflow:hidden;transition:height 250ms ease;height:0;padding-bottom:2px; }.ve-init-mw-desktopArticleTarget-toolbarPlaceholder-bar{transform:translateY(-100%);transition:transform 250ms ease}.ve-init-mw-desktopArticleTarget-toolbarPlaceholder-open .ve-init-mw-desktopArticleTarget-toolbarPlaceholder-bar{transform:translateY(0)}.ve-init-mw-desktopArticleTarget-toolbarPlaceholder-floating{transition:none}.ve-init-mw-desktopArticleTarget-toolbarPlaceholder-floating .ve-init-mw-desktopArticleTarget-toolbarPlaceholder-bar{position:fixed;top:0;z-index:1;background:#fff} .oo-ui-element-hidden{display:none !important; } .mw-editsection{ unicode-bidi:-moz-isolate;unicode-bidi:-webkit-isolate;unicode-bidi:isolate}.mw-editsection:before{content:'\\200B'}.mw-editsection a{white-space:nowrap}.mw-editsection-divider{color:#54595d} .ve-init-mw-desktopArticleTarget-toolbarPlaceholder-bar{height:42px;border-bottom:1px solid #c8ccd1;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}.ve-init-mw-desktopArticleTarget-toolbarPlaceholder-floating,.ve-init-mw-desktopArticleTarget-toolbarPlaceholder-open{height:42px}" ]},{"accesskey-ca-editsource":"e","accesskey-ca-ve-edit":"v","pipe-separator":" | ","postedit-confirmation-created":"Halaman telah dibuat.","postedit-confirmation-published":"Suntingan Anda diterbitkan.","postedit-confirmation-restored":"Halaman telah dipulihkan.","postedit-confirmation-saved":"Suntingan Anda tersimpan.","tooltip-ca-createsource":"Buat kode sumber halaman ini","tooltip-ca-edit":"Sunting halaman ini","tooltip-ca-editsource":"Sunting kode sumber halaman ini","tooltip-ca-ve-edit":"Sunting halaman ini","visualeditor-ca-editsource":"Sunting sumber","visualeditor-ca-createsource":"Buat (teks wiki)","edit-local":"Sunting deskripsi lokal","visualeditor-ca-editlocaldescriptionsource":"Sunting sumber deskripsi lokal","create-local":"Tambah deskripsi lokal","visualeditor-ca-createlocaldescriptionsource":"Tambah sumber deskripsi lokal","editsection":"sunting","visualeditor-ca-editsource-section":"sunting sumber","skin-view-edit":"Sunting","skin-view-create":"Buat"});mw.loader.implement("ext.visualEditor.progressBarWidget@1rnzo",function($,jQuery,require,module){mw.libs.ve=mw.libs.ve||{};mw.libs.ve.ProgressBarWidget=function VeUiMwProgressBarWidget(){this.progressStep=0;this.progressSteps=[[30,3000],[70,2000],[100,1000]];this.$bar=$('
').addClass('ve-init-mw-progressBarWidget-bar').css('width',0);this.$element=$('
').addClass('ve-init-mw-progressBarWidget').append(this.$bar);};mw.libs.ve.ProgressBarWidget.prototype.setLoadingProgress=function(target,duration){var $bar=this.$bar.stop();$bar.css('transition','width '+duration+'ms ease-in');setTimeout(function(){$bar.css('width',target+'%');});};mw.libs.ve.ProgressBarWidget.prototype.incrementLoadingProgress=function(){var step=this.progressSteps[this.progressStep];if(step){this.setLoadingProgress(step[0],step[1]);this.progressStep++;}};mw.libs.ve.ProgressBarWidget.prototype.clearLoading=function(){this.progressStep=0;this.setLoadingProgress(0,0);};},{"css":[ ".ve-init-mw-progressBarWidget{height:1em;overflow:hidden;margin:0 25%}.ve-init-mw-progressBarWidget-bar{height:1em;width:0} .ve-init-mw-progressBarWidget{background-color:#fff;box-sizing:border-box;height:0.875em;border:1px solid #36c;border-radius:0.875em;box-shadow:0 1px 1px rgba(0,0,0,0.15)}.ve-init-mw-progressBarWidget-bar{background-color:#36c;height:0.875em}"]});mw.loader.implement("ext.visualEditor.supportCheck@13rwp",function($,jQuery,require,module){(function(){window.VisualEditorSupportCheck=function(){return((function(){'use strict';return!this&&!!Function.prototype.bind&&!!window.JSON;}())&&!!('contentEditable'in document.createElement('div'))&&!!document.createElementNS&&(function(){var doc;try{doc=new DOMParser().parseFromString('','text/html');}catch(e){}return doc instanceof HTMLDocument;}())&&!!(('classList'in document.createElement('_'))||('classList'in document.createElementNS('http://www.w3.org/2000/svg ','g')))&&!!('createSVGRect'in document.createElementNS('http://www.w3.org/2000/svg','svg')));};}());});mw.loader.implement("ext.visualEditor.targetLoader@cft6d",function($,jQuery,require,module){mw.libs.ve=mw.libs.ve||{};mw.libs.ve.resolveUrl=function(url,base){var node=base.createElement('a');node.setAttribute('href',url);return node.href||url;};mw.libs.ve.decodeURIComponentIntoArticleTitle=function(s,preserveUnderscores){try{s=decodeURIComponent(s);}catch(e){return s;}if(preserveUnderscores){return s;}return s.replace(/_/g,' ');};mw.libs.ve.unwrapParsoidSections=function(element,keepSection){Array.prototype.forEach.call(element.querySelectorAll('section[data-mw-section-id]'),function(section){var parent=section.parentNode,sectionId=section.getAttribute('data-mw-section-id');if(sectionId!==null&&+sectionId>0){section.firstChild.setAttribute('data-mw-section-id',sectionId);}if(keepSection!==undefined&§ionId===keepSection){return;}while(section.firstChild){parent.insertBefore(section.firstChild,section);}parent.removeChild(section);});};mw.libs.ve.stripParsoidFallbackIds=function( element){Array.prototype.forEach.call(element.querySelectorAll('span[typeof="mw:FallbackId"][id]:empty'),function(legacySpan){legacySpan.parentNode.removeChild(legacySpan);});};mw.libs.ve.restbaseIdRegExp=/^mw[a-zA-Z0-9\-_]{2,6}$/;mw.libs.ve.stripRestbaseIds=function(doc){var restbaseIdRegExp=mw.libs.ve.restbaseIdRegExp;Array.prototype.forEach.call(doc.querySelectorAll('[id^="mw"]'),function(element){if(restbaseIdRegExp.test(element.id)){element.removeAttribute('id');}});};mw.libs.ve.reduplicateStyles=function(element){Array.prototype.forEach.call(element.querySelectorAll('link[rel~="mw-deduplicated-inline-style"]'),function(link){var href=link.getAttribute('href');if(!href||href.slice(0,'mw-data:'.length)!=='mw-data:'){return;}var key=href.slice('mw-data:'.length);var style=element.querySelector('style[data-mw-deduplicate="'+key+'"]');if(!style){return;}var newStyle=link.ownerDocument.createElement('style');newStyle.setAttribute('data-mw-deduplicate',key);for(var i=0;i1){href=relativeHref;isInternal=false;}}if(isInternal===null){var articleBase=mw.libs.ve.resolveUrl(mw.config.get('wgArticlePath'),doc).replace(/^https?:/i,'');var articleBaseRegex=new RegExp(regexEscape(articleBase).replace(regexEscape('$1'),'(.*)'));var matches=relativeHref.match(articleBaseRegex);if(matches&&matches[1].split('#')[0].indexOf('?')===-1){href=matches[1];isInternal=true;}else{isInternal=false;}}}var data=mw.libs.ve.parseParsoidResourceName(href);data.isInternal=isInternal;return data;};mw.libs.ve.parseParsoidResourceName=function(resourceName){var matches=resourceName.match(/^(\.\/|)(.*)$/);return{title:mw.libs.ve.decodeURIComponentIntoArticleTitle(matches[2]),rawTitle:matches[2]};};mw.libs.ve.normalizeParsoidResourceName=function(resourceName){return mw.libs.ve.parseParsoidResourceName(resourceName).title;};(function(){var conf=mw.config.get('wgVisualEditorConfig'),pluginCallbacks=[],modules=['ext.visualEditor.articleTarget'].concat(conf.pluginModules.filter(mw.loader.getState));var uri;try{uri=new mw.Uri();}catch(e){uri=false;}if(uri&&conf.enableWikitext&&(mw.user.options.get('visualeditor-newwikitext')||uri.query.veaction==='editsource')&&mw.loader.getState('ext.visualEditor.mwwikitext')){modules.push('ext.visualEditor.mwwikitext');}var namespaces=mw.config.get('wgNamespaceIds');if(Object.keys(namespaces).some(function(name){return mw.Title.wantSignaturesNamespace(namespaces[name]);})){modules.push('ext.visualEditor.mwsignature');}for(var prefName in conf.preferenceModules){var prefValue=mw.user.options.get(prefName);if( prefValue&&prefValue!=='0'){modules.push(conf.preferenceModules[prefName]);}}mw.libs.ve=mw.libs.ve||{};mw.libs.ve.targetLoader={addPlugin:function(plugin){if(typeof plugin==='string'){modules.push(plugin);}else{pluginCallbacks.push(plugin);}},loadModules:function(mode){mw.hook('ve.loadModules').fire(this.addPlugin.bind(this));ve.track('trace.moduleLoad.enter',{mode:mode});return mw.loader.using(modules).then(function(){ve.track('trace.moduleLoad.exit',{mode:mode});pluginCallbacks.push(ve.init.platform.getInitializedPromise.bind(ve.init.platform));return $.when.apply($,pluginCallbacks.map(function(callback){return callback();}));});},createCheckboxFields:function(checkboxesDef,widgetConfig){var checkboxFields=[],checkboxesByName={};if(checkboxesDef){Object.keys(checkboxesDef).forEach(function(name){var options=checkboxesDef[name],accesskey=null,title=null;if(options.tooltip){accesskey=mw.message('accesskey-'+options.tooltip).text();title=mw.message('tooltip-'+options.tooltip).text();}if (options['title-message']){title=mw.message(options['title-message']).text();}var $label=mw.message(options['label-message']).parseDom();var config=$.extend({accessKey:accesskey,classes:['ve-ui-mwSaveDialog-checkbox-'+name]},widgetConfig);var checkbox;switch(options.class){case'OOUI\\DropdownInputWidget':checkbox=new OO.ui.DropdownInputWidget($.extend(config,{value:options.default,options:options.options}));break;default:checkbox=new OO.ui.CheckboxInputWidget($.extend(config,{selected:options.default}));break;}checkboxFields.push(new OO.ui.FieldLayout(checkbox,{align:'inline',label:$label,title:title,invisibleLabel:!!options.invisibleLabel,classes:['ve-ui-mwSaveDialog-field-'+name]}));checkboxesByName[name]=checkbox;});}return{checkboxFields:checkboxFields,checkboxesByName:checkboxesByName};},requestPageData:function(mode,pageName,options){options=options||{};var apiRequest=mode==='source'?this.requestWikitext.bind(this,pageName,options):this.requestParsoidData.bind(this,pageName, options);if(options.sessionStore){var sessionState;try{sessionState=JSON.parse(mw.storage.session.get('ve-docstate'));}catch(e){}if(sessionState){var request=sessionState.request||{};var enableVisualSectionEditing=conf.enableVisualSectionEditing;var section=request.mode==='source'||enableVisualSectionEditing===true||enableVisualSectionEditing===options.targetName?options.section:null;if(request.pageName===pageName&&request.mode===mode&&request.section===section){var dataPromise=$.Deferred().resolve({visualeditor:$.extend({content:mw.storage.session.get('ve-dochtml')},sessionState.response,{recovered:true})}).promise();if(sessionState.response.oldid===mw.config.get('wgCurRevisionId')){return dataPromise;}else{ve.track=function(){};return mw.loader.using('oojs-ui-windows').then(function(){return OO.ui.confirm(mw.msg('visualeditor-autosave-modified-prompt-message'),{title:mw.msg('visualeditor-autosave-modified-prompt-title'),actions:[{action:'accept',label:mw.msg( 'visualeditor-autosave-modified-prompt-accept'),flags:['primary','progressive']},{action:'reject',label:mw.msg('visualeditor-autosave-modified-prompt-reject'),flags:'destructive'}]}).then(function(confirmed){if(confirmed){return dataPromise;}else{mw.storage.session.remove('ve-docstate');return apiRequest();}});});}}}}return apiRequest();},requestParsoidData:function(pageName,options,noRestbase,noMetadata){var section=options.section!==undefined?options.section:null,useRestbase=!noRestbase&&(conf.fullRestbaseUrl||conf.restbaseUrl)&§ion===null,switched=false,fromEditedState=false;options=options||{};var data={action:'visualeditor',paction:useRestbase?'metadata':'parse',page:pageName,badetag:options.badetag,uselang:mw.config.get('wgUserLanguage'),editintro:options.editintro,preload:options.preload,preloadparams:options.preloadparams,formatversion:2};if(options.oldId!==undefined){data.oldid=options.oldId;}var start=ve.now();ve.track('trace.apiLoad.enter',{mode:'visual'});var apiXhr, apiPromise;if(!useRestbase&&options.wikitext!==undefined){data.paction='parse';data.stash=true;switched=true;fromEditedState=options.modified;data.wikitext=options.wikitext;data.section=options.section;data.oldid=options.oldId;apiXhr=new mw.Api().post(data);}else{if(useRestbase&&noMetadata){apiPromise=$.Deferred().resolve({visualeditor:{}}).promise();}else{apiXhr=new mw.Api().get(data);}}if(!apiPromise){apiPromise=apiXhr.then(function(response,jqxhr){ve.track('trace.apiLoad.exit',{mode:'visual'});ve.track('mwtiming.performance.system.apiLoad',{bytes:require('mediawiki.String').byteLength(jqxhr.responseText),duration:ve.now()-start,cacheHit:/hit/i.test(jqxhr.getResponseHeader('X-Cache')),targetName:options.targetName,mode:'visual'});if(response.visualeditor){response.visualeditor.switched=switched;response.visualeditor.fromEditedState=fromEditedState;}return response;});}var dataPromise,abort;if(useRestbase){ve.track('trace.restbaseLoad.enter',{mode:'visual'});var headers={Accept: 'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.4.0"','Accept-Language':mw.config.get('wgVisualEditor').pageLanguageCode,'Api-User-Agent':'VisualEditor-MediaWiki/'+mw.config.get('wgVersion')};var restbaseXhr,pageHtmlUrl;if(options.wikitext!==undefined&&!$('[name=wpSection]').val()){if(conf.fullRestbaseUrl){pageHtmlUrl=conf.fullRestbaseUrl+'v1/transform/wikitext/to/html/';}else{pageHtmlUrl=conf.restbaseUrl.replace('v1/page/html/','v1/transform/wikitext/to/html/');}switched=true;fromEditedState=options.modified;window.onbeforeunload=null;$(window).off('beforeunload');restbaseXhr=$.ajax({url:pageHtmlUrl+encodeURIComponent(pageName)+(data.oldid===undefined?'':'/'+data.oldid),type:'POST',data:{title:pageName,wikitext:options.wikitext,stash:'true'},headers:headers,dataType:'text'});}else{if(conf.fullRestbaseUrl){pageHtmlUrl=conf.fullRestbaseUrl+'v1/page/html/';}else{pageHtmlUrl=conf.restbaseUrl;}restbaseXhr=$.ajax({url:pageHtmlUrl+encodeURIComponent(pageName)+ (data.oldid===undefined?'':'/'+data.oldid)+'?redirect=false&stash=true',type:'GET',headers:headers,dataType:'text'});}var restbasePromise=restbaseXhr.then(function(response,status,jqxhr){ve.track('trace.restbaseLoad.exit',{mode:'visual'});ve.track('mwtiming.performance.system.restbaseLoad',{bytes:require('mediawiki.String').byteLength(jqxhr.responseText),duration:ve.now()-start,targetName:options.targetName,mode:'visual'});return[response,jqxhr.getResponseHeader('etag')];},function(xhr,code,_){if(xhr.status===404){return $.Deferred().resolve(['',undefined]).promise();}else{mw.log.warn('RESTBase load failed: '+xhr.statusText);return $.Deferred().reject(code,xhr,_).promise();}});dataPromise=$.when(apiPromise,restbasePromise).then(function(apiData,restbaseData){if(apiData.visualeditor){if(restbaseData[0]||!apiData.visualeditor.content){apiData.visualeditor.content=restbaseData[0];apiData.visualeditor.etag=restbaseData[1];}apiData.visualeditor.switched=switched;apiData.visualeditor. fromEditedState=fromEditedState;}return apiData;});abort=function(){if(apiXhr){apiXhr.abort();}restbaseXhr.abort();};}else{dataPromise=apiPromise;if(apiXhr){abort=apiXhr.abort;}}return dataPromise.then(function(resp){var etagRegexp=/^(?:W\/)?"?([^"/]+)(?:\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))(?:\/([^"]+))?"?$/;if(useRestbase&&resp.visualeditor.content&&(!resp.visualeditor.etag||!etagRegexp.test(resp.visualeditor.etag))){return mw.libs.ve.targetLoader.requestParsoidData(pageName,$.extend({},options,{badetag:resp.visualeditor.etag||''}),true);}resp.veMode='visual';return resp;}).promise({abort:abort});},requestWikitext:function(pageName,options){options=options||{};var data={action:'visualeditor',paction:'wikitext',page:pageName,uselang:mw.config.get('wgUserLanguage'),editintro:options.editintro,preload:options.preload,preloadparams:options.preloadparams,formatversion:2};if(options.section!==null&&options.section!==undefined){data.section=options.section;}if( options.oldId!==undefined){data.oldid=options.oldId;}var dataPromise=new mw.Api().get(data);return dataPromise.then(function(resp){resp.veMode='source';return resp;}).promise({abort:dataPromise.abort});}};}());(function(){mw.libs.ve=mw.libs.ve||{};mw.libs.ve.targetSaver={preloadDeflate:function(){mw.loader.load('mediawiki.deflate');},deflate:function(html){return mw.loader.using('mediawiki.deflate').then(function(){return mw.deflate(html);});},getHtml:function(newDoc,oldDoc){function copyAttributes(from,to){Array.prototype.forEach.call(from.attributes,function(attr){to.setAttribute(attr.name,attr.value);});}if(oldDoc){for(var i=0,len=oldDoc.head.childNodes.length;il?text.slice(0,l)+'…':text;}var errorMessage='DOM content matching deny list found:\n'+truncate(this.outerHTML,100)+'\nContext:\n'+truncate(this.parentNode.outerHTML,200);mw.log.error(errorMessage);var err=new Error(errorMessage);err.name='VeDomDenyListWarning';mw.errorLogger.logError(err,'error.visualeditor');$(this).remove();});$(newDoc).find('[data-mw-section-id]:not( section )').removeAttr('data-mw-section-id');mw.libs.ve.deduplicateStyles(newDoc.body);return''+ve.serializeXhtml(newDoc);},deflateDoc:function(doc,oldDoc){return this.deflate(this.getHtml(doc,oldDoc));},saveDoc:function(doc,extraData,options){var saver=this;return this.deflateDoc(doc).then(function(html){return saver.postHtml(html ,null,extraData,options);});},postWikitext:function(wikitext,extraData,options){return this.postContent($.extend({wikitext:wikitext},extraData),options);},postHtml:function(html,cacheKey,extraData,options){var saver=this;options=options||{};var data;if(cacheKey){data=$.extend({cachekey:cacheKey},extraData);}else{data=$.extend({html:html},extraData);}return this.postContent(data,options).then(null,function(code,response){if(options.onCacheKeyFail){options.onCacheKeyFail();}if(code==='badcachekey'){return saver.postHtml(html,null,extraData,options);}return $.Deferred().reject(code,response).promise();});},postContent:function(data,options){options=options||{};var api=options.api||new mw.Api();var start;if(options.now){start=options.now();}data=$.extend({action:'visualeditoredit',paction:'save',useskin:mw.config.get('skin'),mobileformat:!!mw.config.get('wgMFMode'),formatversion:2,errorformat:'html',errorlang:mw.config.get('wgUserLanguage'),errorsuselocal:true,editingStatsId:window.ve&& window.ve.init&&window.ve.init.editingSessionId},data);var action=data.action;var request=api.postWithToken('csrf',data,{contentType:'multipart/form-data'});return request.then(function(response,jqxhr){var responseData=response[action];if(options.track&&options.eventName){var eventData={bytes:require('mediawiki.String').byteLength(jqxhr.responseText),duration:options.now()-start};var fullEventName='performance.system.'+options.eventName+(responseData.cachekey?'.withCacheKey':'.withoutCacheKey');options.track(fullEventName,eventData);}var error;if(!responseData){error={code:'invalidresponse',html:mw.message('api-clientside-error-invalidresponse').parse()};}else if(responseData.result!=='success'){return $.Deferred().reject('no-error-no-success',response).promise();}else{switch(responseData.paction){case'save':case'serialize':if(typeof responseData.content!=='string'){error={code:'invalidcontent',html:mw.message('api-clientside-error-invalidresponse').parse()};}break;case'diff':if(typeof responseData.diff!=='string'){error={code:'invalidcontent',html:mw.message('api-clientside-error-invalidresponse').parse()};}break;}}if(error){return $.Deferred().reject(error.code,{errors:[error]}).promise();}return responseData;},function(code,response){var responseText=OO.getProp(response,'xhr','responseText');if(responseText&&options.track&&options.eventName){var eventData={bytes:require('mediawiki.String').byteLength(responseText),duration:options.now()-start};var fullEventName;if(code==='badcachekey'){fullEventName='performance.system.'+options.eventName+'.badCacheKey';}else{fullEventName='performance.system.'+options.eventName+'.withoutCacheKey';}options.track(fullEventName,eventData);}return $.Deferred().reject(code,response).promise();});}};}());},{},{"visualeditor-autosave-modified-prompt-accept":"Lanjutkan penyuntingan","visualeditor-autosave-modified-prompt-message": "Halaman ini pernah disunting setelah Anda memuatnya terakhir kali. Apakah {{GENDER:|Anda}} ingin melanjutkan suntingan {{GENDER:|Anda}} atas versi yang lama, atau memulai suntingan baru dari versi terakhir?","visualeditor-autosave-modified-prompt-reject":"Mulai suntingan baru","visualeditor-autosave-modified-prompt-title":"Lanjutkan suntingan {{GENDER:|Anda}}?"});mw.loader.implement("ext.visualEditor.tempWikitextEditorWidget@k7mf7",function($,jQuery,require,module){mw.libs.ve=mw.libs.ve||{};mw.libs.ve.MWTempWikitextEditorWidget=function VeUiMwTempWikitextEditorWidget(config){var conf=mw.config.get('wgVisualEditor'),dir=conf.pageLanguageDir,lang=conf.pageLanguageCode;this.$element=$('