export const __webpack_esm_id__=18283;export const __webpack_esm_ids__=[18283];export const __webpack_esm_modules__={18283(e,t,n){var o=n(41767);function r(e,t,n,r,i){return{template:'\n            <style>\n                .open-in-sparql-editor-btn {\n                    line-height: 0.75;\n                }\n                .open-in-sparql-editor-btn .fa:nth-child(2) {\n                    margin-left: -0.2em;\n                    margin-right: -0.2em;\n                    font-size: 0.9em;\n                }\n            </style>\n            <button class="btn btn-link btn-sm open-in-sparql-editor-btn"\n                   data-test="open-in-sparql-editor-btn"\n                   gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n                <i class="ri-braces-line"></i>\n            </button>\n        ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@",addPrefixes:"@"},link:function(a,s){a.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";const p="true"===a.executeQuery,l="true"===a.addPrefixes;a.onGoToSparqlEditorView=()=>{const r=e.getActiveRepository();r&&r===a.repositoryId?c(a.query):n.openConfirmationModal({title:t.instant("common.confirm"),message:(0,o.Gz)(t.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:a.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{e.setRepository(e.getRepository(a.repositoryId)),c(a.query)})};const c=e=>{if(l){const t=r.open("about:blank","_blank");i.addKnownPrefixes(JSON.stringify(e)).then(e=>{const n=e.data;d(n,t)}).catch(()=>{d(e,t)})}else d(e)},d=(e,t)=>{const n=`sparql?query=${encodeURIComponent(e)}&execute=${p}`;t?t.location.href=n:r.open(n,"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",r),r.$inject=["$repositories","$translate","ModalService","$window","SparqlRestService"]}};
//# sourceMappingURL=18283.bd68e03e21232b53913f.bundle.js.map