[{"data":1,"prerenderedAt":712,"buildId":713},["ShallowReactive",2],{"docs-navigation-en":3,"example-\u002Fexamples\u002Fdisplay-format":30,"example-surround-\u002Fexamples\u002Fdisplay-format":622,"examples-en":631},[4],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Docs","\u002Fdocs","docs",[9,13,17,21,25],{"title":10,"path":11,"stem":12},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",{"title":14,"path":15,"stem":16},"In the browser and with frameworks","\u002Fdocs\u002Fin-the-browser","docs\u002F2.in-the-browser",{"title":18,"path":19,"stem":20},"Input rules","\u002Fdocs\u002Finput-rules","docs\u002F3.input-rules",{"title":22,"path":23,"stem":24},"Compared with libphonenumber","\u002Fdocs\u002Flibphonenumber","docs\u002F4.libphonenumber",{"title":26,"path":27,"stem":28},"Data and sources","\u002Fdocs\u002Fdata-and-sources","docs\u002F5.data-and-sources",false,{"id":31,"title":32,"body":33,"category":612,"demo":613,"description":614,"extension":615,"meta":616,"navigation":131,"order":93,"path":617,"seo":618,"stem":619,"uses":620,"__hash__":621},"examples_en\u002Fexamples\u002Fdisplay-format.md","Store digits, show hyphens",{"type":34,"value":35,"toc":608},"minimark",[36,41,54,72,76,593,596,604],[37,38,40],"h2",{"id":39},"how-it-works","How it works",[42,43,44,45,49,50,53],"p",{},"Many systems store numbers as digits only. To show them, call ",[46,47,48],"code",{},"normalize"," on the digits and use ",[46,51,52],{},"national",".",[42,55,56,57,60,61,64,65,60,68,71],{},"You cannot place the hyphens by counting digits. ",[46,58,59],{},"0499823111"," is ",[46,62,63],{},"04998-2-3111"," and ",[46,66,67],{},"0942210000",[46,69,70],{},"0942-21-0000",": the length of the area code depends on the number. japan-phone reads it from the MIC tables.",[37,73,75],{"id":74},"in-each-language","In each language",[77,78,79,271,394],"code-group",{},[80,81,87],"pre",{"className":82,"code":83,"filename":84,"language":85,"meta":86,"style":86},"language-js shiki shiki-themes material-theme-lighter github-light github-dark","import { normalize } from \"@kurashina-design\u002Fjapan-phone\";\n\n\u002F\u002F Store only the digits, and add the hyphens when you show the number.\n\u002F\u002F The groups come from the numbering table: you cannot place them by counting digits.\nfor (const digits of [\"0352538111\", \"0499823111\", \"0942210000\", \"0570123456\", \"0120950178\"]) {\n  console.log(digits, \"->\", normalize(digits).national);\n}\n","Node.js","js","",[46,88,89,126,133,140,146,218,265],{"__ignoreMap":86},[90,91,94,98,102,106,109,112,116,120,123],"span",{"class":92,"line":93},"line",1,[90,95,97],{"class":96},"sVHd0","import",[90,99,101],{"class":100},"sP7_E"," {",[90,103,105],{"class":104},"su5hD"," normalize",[90,107,108],{"class":100}," }",[90,110,111],{"class":96}," from",[90,113,115],{"class":114},"sjJ54"," \"",[90,117,119],{"class":118},"s_sjI","@kurashina-design\u002Fjapan-phone",[90,121,122],{"class":114},"\"",[90,124,125],{"class":100},";\n",[90,127,129],{"class":92,"line":128},2,[90,130,132],{"emptyLinePlaceholder":131},true,"\n",[90,134,136],{"class":92,"line":135},3,[90,137,139],{"class":138},"sutJx","\u002F\u002F Store only the digits, and add the hyphens when you show the number.\n",[90,141,143],{"class":92,"line":142},4,[90,144,145],{"class":138},"\u002F\u002F The groups come from the numbering table: you cannot place them by counting digits.\n",[90,147,149,152,155,159,163,167,170,172,175,177,180,182,184,186,188,190,192,194,196,198,201,203,205,207,210,212,215],{"class":92,"line":148},5,[90,150,151],{"class":96},"for",[90,153,154],{"class":104}," (",[90,156,158],{"class":157},"sbsja","const",[90,160,162],{"class":161},"s_hVV"," digits",[90,164,166],{"class":165},"smGrS"," of",[90,168,169],{"class":104}," [",[90,171,122],{"class":114},[90,173,174],{"class":118},"0352538111",[90,176,122],{"class":114},[90,178,179],{"class":100},",",[90,181,115],{"class":114},[90,183,59],{"class":118},[90,185,122],{"class":114},[90,187,179],{"class":100},[90,189,115],{"class":114},[90,191,67],{"class":118},[90,193,122],{"class":114},[90,195,179],{"class":100},[90,197,115],{"class":114},[90,199,200],{"class":118},"0570123456",[90,202,122],{"class":114},[90,204,179],{"class":100},[90,206,115],{"class":114},[90,208,209],{"class":118},"0120950178",[90,211,122],{"class":114},[90,213,214],{"class":104},"]) ",[90,216,217],{"class":100},"{\n",[90,219,221,224,226,230,234,237,239,241,244,246,248,250,252,254,257,259,261,263],{"class":92,"line":220},6,[90,222,223],{"class":104},"  console",[90,225,53],{"class":100},[90,227,229],{"class":228},"sGLFI","log",[90,231,233],{"class":232},"skxfh","(",[90,235,236],{"class":104},"digits",[90,238,179],{"class":100},[90,240,115],{"class":114},[90,242,243],{"class":118},"->",[90,245,122],{"class":114},[90,247,179],{"class":100},[90,249,105],{"class":228},[90,251,233],{"class":232},[90,253,236],{"class":104},[90,255,256],{"class":232},")",[90,258,53],{"class":100},[90,260,52],{"class":104},[90,262,256],{"class":232},[90,264,125],{"class":100},[90,266,268],{"class":92,"line":267},7,[90,269,270],{"class":100},"}\n",[80,272,277],{"className":273,"code":274,"filename":275,"language":276,"meta":86,"style":86},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from japan_phone import normalize\n\n# Store only the digits, and add the hyphens when you show the number.\n# The groups come from the numbering table: you cannot place them by counting digits.\nfor digits in [\"0352538111\", \"0499823111\", \"0942210000\", \"0570123456\", \"0120950178\"]:\n    print(digits, \"->\", normalize(digits).national)\n","Python","python",[46,278,279,292,296,301,306,359],{"__ignoreMap":86},[90,280,281,284,287,289],{"class":92,"line":93},[90,282,283],{"class":96},"from",[90,285,286],{"class":104}," japan_phone ",[90,288,97],{"class":96},[90,290,291],{"class":104}," normalize\n",[90,293,294],{"class":92,"line":128},[90,295,132],{"emptyLinePlaceholder":131},[90,297,298],{"class":92,"line":135},[90,299,300],{"class":138},"# Store only the digits, and add the hyphens when you show the number.\n",[90,302,303],{"class":92,"line":142},[90,304,305],{"class":138},"# The groups come from the numbering table: you cannot place them by counting digits.\n",[90,307,308,310,313,316,318,320,322,324,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,356],{"class":92,"line":148},[90,309,151],{"class":96},[90,311,312],{"class":104}," digits ",[90,314,315],{"class":96},"in",[90,317,169],{"class":100},[90,319,122],{"class":114},[90,321,174],{"class":118},[90,323,122],{"class":114},[90,325,179],{"class":100},[90,327,115],{"class":114},[90,329,59],{"class":118},[90,331,122],{"class":114},[90,333,179],{"class":100},[90,335,115],{"class":114},[90,337,67],{"class":118},[90,339,122],{"class":114},[90,341,179],{"class":100},[90,343,115],{"class":114},[90,345,200],{"class":118},[90,347,122],{"class":114},[90,349,179],{"class":100},[90,351,115],{"class":114},[90,353,209],{"class":118},[90,355,122],{"class":114},[90,357,358],{"class":100},"]:\n",[90,360,361,365,367,370,372,374,376,378,380,382,384,386,389,391],{"class":92,"line":220},[90,362,364],{"class":363},"sptTA","    print",[90,366,233],{"class":100},[90,368,236],{"class":369},"slqww",[90,371,179],{"class":100},[90,373,115],{"class":114},[90,375,243],{"class":118},[90,377,122],{"class":114},[90,379,179],{"class":100},[90,381,105],{"class":369},[90,383,233],{"class":100},[90,385,236],{"class":369},[90,387,388],{"class":100},").",[90,390,52],{"class":232},[90,392,393],{"class":100},")\n",[80,395,400],{"className":396,"code":397,"filename":398,"language":399,"meta":86,"style":86},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","import jp.kurashina.japanphone.JapanPhoneNumber;\nimport jp.kurashina.japanphone.JapanPhone;\n\n\u002F\u002F Store only the digits, and add the hyphens when you show the number.\n\u002F\u002F The groups come from the numbering table: you cannot place them by counting digits.\nfor (String digits : new String[] {\"0352538111\", \"0499823111\", \"0942210000\", \"0570123456\", \"0120950178\"}) {\n  System.out.println(digits + \" -> \" + JapanPhone.normalize(digits).get().getNational());\n}\n","Java","java",[46,401,402,428,449,453,457,461,530,588],{"__ignoreMap":86},[90,403,404,407,411,413,416,418,421,423,426],{"class":92,"line":93},[90,405,97],{"class":406},"sw1J6",[90,408,410],{"class":409},"s_bVq"," jp",[90,412,53],{"class":100},[90,414,415],{"class":409},"kurashina",[90,417,53],{"class":100},[90,419,420],{"class":409},"japanphone",[90,422,53],{"class":100},[90,424,425],{"class":409},"JapanPhoneNumber",[90,427,125],{"class":100},[90,429,430,432,434,436,438,440,442,444,447],{"class":92,"line":128},[90,431,97],{"class":406},[90,433,410],{"class":409},[90,435,53],{"class":100},[90,437,415],{"class":409},[90,439,53],{"class":100},[90,441,420],{"class":409},[90,443,53],{"class":100},[90,445,446],{"class":409},"JapanPhone",[90,448,125],{"class":100},[90,450,451],{"class":92,"line":135},[90,452,132],{"emptyLinePlaceholder":131},[90,454,455],{"class":92,"line":142},[90,456,139],{"class":138},[90,458,459],{"class":92,"line":148},[90,460,145],{"class":138},[90,462,463,465,467,470,472,475,478,481,484,486,488,490,492,494,496,498,500,502,504,506,508,510,512,514,516,518,520,522,524,527],{"class":92,"line":220},[90,464,151],{"class":96},[90,466,154],{"class":100},[90,468,469],{"class":409},"String",[90,471,312],{"class":104},[90,473,474],{"class":96},":",[90,476,477],{"class":96}," new",[90,479,480],{"class":157}," String",[90,482,483],{"class":100},"[]",[90,485,101],{"class":100},[90,487,122],{"class":114},[90,489,174],{"class":118},[90,491,122],{"class":114},[90,493,179],{"class":100},[90,495,115],{"class":114},[90,497,59],{"class":118},[90,499,122],{"class":114},[90,501,179],{"class":100},[90,503,115],{"class":114},[90,505,67],{"class":118},[90,507,122],{"class":114},[90,509,179],{"class":100},[90,511,115],{"class":114},[90,513,200],{"class":118},[90,515,122],{"class":114},[90,517,179],{"class":100},[90,519,115],{"class":114},[90,521,209],{"class":118},[90,523,122],{"class":114},[90,525,526],{"class":100},"})",[90,528,529],{"class":100}," {\n",[90,531,532,535,537,540,542,545,547,550,553,555,558,560,563,566,568,570,572,574,576,579,582,585],{"class":92,"line":267},[90,533,534],{"class":104},"  System",[90,536,53],{"class":100},[90,538,539],{"class":104},"out",[90,541,53],{"class":100},[90,543,544],{"class":228},"println",[90,546,233],{"class":100},[90,548,549],{"class":104},"digits ",[90,551,552],{"class":165},"+",[90,554,115],{"class":114},[90,556,557],{"class":118}," -> ",[90,559,122],{"class":114},[90,561,562],{"class":165}," +",[90,564,565],{"class":104}," JapanPhone",[90,567,53],{"class":100},[90,569,48],{"class":228},[90,571,233],{"class":100},[90,573,236],{"class":104},[90,575,388],{"class":100},[90,577,578],{"class":228},"get",[90,580,581],{"class":100},"().",[90,583,584],{"class":228},"getNational",[90,586,587],{"class":100},"());\n",[90,589,591],{"class":92,"line":590},8,[90,592,270],{"class":100},[42,594,595],{},"Output:",[80,597,602],{"className":598,"code":600,"language":601,"meta":86},[599],"language-text","0352538111 -> 03-5253-8111\n0499823111 -> 04998-2-3111\n0942210000 -> 0942-21-0000\n0570123456 -> 0570-123-456\n0120950178 -> 0120-950-178\n","text",[46,603,600],{"__ignoreMap":86},[605,606,607],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_bVq, html code.shiki .s_bVq{--shiki-light:#9C3EDA;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":86,"searchDepth":128,"depth":128,"links":609},[610,611],{"id":39,"depth":128,"text":40},{"id":74,"depth":128,"text":75},"data","display-format","Format stored digits with the groups from the numbering table.","md",{},"\u002Fexamples\u002Fdisplay-format",{"title":32,"description":614},"examples\u002Fdisplay-format",[48,52],"wSqc-CMRYS5twJQdAzGYo6M6JluLNFuJW0n0FH37WMw",[623,627],{"path":624,"title":625,"description":626,"category":601,"order":135},"\u002Fexamples\u002Fcompany-page","List the numbers on a company page","Find TEL and FAX numbers and drop duplicates written in other notations.",{"path":628,"title":629,"description":630,"category":612,"order":128},"\u002Fexamples\u002Fdedupe","Find duplicates written differently","Group entries that are the same number in different notations.",[632,639,645,652,659,666,672,675,677,680,686,692,698,706],{"path":633,"title":634,"description":635,"category":636,"order":93,"uses":637,"demo":638},"\u002Fexamples\u002Fvalidate-input","Validate a phone number field","Accept full-width input, reject numbers that do not exist, and save one notation.","forms",[48],"validate-input",{"path":640,"title":641,"description":642,"category":636,"order":128,"uses":643,"demo":644},"\u002Fexamples\u002Fpaste-labels","Accept pasted labels and notes","Take the main number from lines like ",[48],"paste-labels",{"path":646,"title":647,"description":648,"category":636,"order":135,"uses":649,"demo":651},"\u002Fexamples\u002Fmobile-only","Accept mobile numbers only","Use the type to decide whether a number can receive SMS.",[48,650],"type","mobile-only",{"path":653,"title":654,"description":655,"category":636,"order":142,"uses":656,"demo":658},"\u002Fexamples\u002Ftel-link","Make tel: links","Link numbers in their international form, and keep domestic-only numbers dialable.",[48,657],"international","tel-link",{"path":660,"title":661,"description":662,"category":601,"order":93,"uses":663,"demo":665},"\u002Fexamples\u002Fextract-inquiry","Find numbers in a message","Pick every phone number out of a message, in the order it appears.",[664],"extract","extract-inquiry",{"path":667,"title":668,"description":669,"category":601,"order":128,"uses":670,"demo":671},"\u002Fexamples\u002Fbusiness-card","Read a business card in kanji digits","Find numbers written with 〇一二三, as on vertical business cards.",[664],"business-card",{"path":624,"title":625,"description":626,"category":601,"order":135,"uses":673,"demo":674},[664,236],"company-page",{"path":617,"title":32,"description":614,"category":612,"order":93,"uses":676,"demo":613},[48,52],{"path":628,"title":629,"description":630,"category":612,"order":128,"uses":678,"demo":679},[48],"dedupe",{"path":681,"title":682,"description":683,"category":612,"order":135,"uses":684,"demo":685},"\u002Fexamples\u002Fcsv-cleanup","Clean a CSV column","Rewrite a phone column in one notation and flag rows that need a person.",[48],"csv-cleanup",{"path":687,"title":688,"description":689,"category":612,"order":142,"uses":690,"demo":691},"\u002Fexamples\u002Ftype-stats","Count numbers by type","See how many entries are mobile, fixed-line, toll-free, or invalid.",[48,650],"type-stats",{"path":693,"title":694,"description":695,"category":612,"order":148,"uses":696,"demo":697},"\u002Fexamples\u002Fe164","Convert to E.164","Pass numbers to SMS gateways, CRMs, and libphonenumber in international form.",[48,657],"e164",{"path":699,"title":700,"description":701,"category":702,"order":93,"uses":703,"demo":705},"\u002Fexamples\u002Fplan-check","Reject numbers that cannot exist","Numbers missing from the numbering plan or the MIC tables are invalid.","rules",[704],"isValid","plan-check",{"path":707,"title":708,"description":709,"category":702,"order":128,"uses":710,"demo":711},"\u002Fexamples\u002Finternational-input","Read numbers written for abroad","Accept +81 notation, including the bracketed (0), for the types that can be dialed from abroad.",[48],"international-input",1796483608003,"73e0e014-4aa7-4f04-8db5-5f7391793162"]